From 1a3c04df57ffe237b97c24db8b7668c1f1e0fa2a Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Fri, 2 Jan 2026 13:37:22 +0100 Subject: [PATCH] migrate reservoir --- apps/charts/reservoir/Chart.yaml | 4 ++ apps/charts/reservoir/templates/database.yaml | 7 +--- .../reservoir/templates/deployment.yaml | 42 +------------------ apps/charts/reservoir/templates/service.yaml | 17 +------- .../reservoir/templates/virtual-service.yaml | 20 +-------- apps/charts/reservoir/values.yaml | 40 ++++++++++++++++++ 6 files changed, 48 insertions(+), 82 deletions(-) diff --git a/apps/charts/reservoir/Chart.yaml b/apps/charts/reservoir/Chart.yaml index a1e3245..9778d95 100644 --- a/apps/charts/reservoir/Chart.yaml +++ b/apps/charts/reservoir/Chart.yaml @@ -1,3 +1,7 @@ apiVersion: v2 version: 1.0.0 name: reservoir +dependencies: + - name: common + version: 1.0.0 + repository: file://../../common diff --git a/apps/charts/reservoir/templates/database.yaml b/apps/charts/reservoir/templates/database.yaml index 6a30b53..8a7fad4 100644 --- a/apps/charts/reservoir/templates/database.yaml +++ b/apps/charts/reservoir/templates/database.yaml @@ -1,6 +1 @@ -apiVersion: homelab.mortenolsen.pro/v1 -kind: PostgresDatabase -metadata: - name: '{{ .Release.Name }}' -spec: - environment: '{{ .Values.globals.environment }}' +{{ include "common.database" . }} diff --git a/apps/charts/reservoir/templates/deployment.yaml b/apps/charts/reservoir/templates/deployment.yaml index c8836f9..4508e33 100644 --- a/apps/charts/reservoir/templates/deployment.yaml +++ b/apps/charts/reservoir/templates/deployment.yaml @@ -1,41 +1 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Release.Name }}" -spec: - strategy: - type: RollingUpdate - replicas: 1 - revisionHistoryLimit: 0 - selector: - matchLabels: - app: "{{ .Release.Name }}" - template: - metadata: - labels: - app: "{{ .Release.Name }}" - spec: - containers: - - name: "{{ .Release.Name }}" - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: "{{ .Values.image.pullPolicy }}" - ports: - - name: http - containerPort: 9111 - protocol: TCP - livenessProbe: - tcpSocket: - port: http - readinessProbe: - tcpSocket: - port: http - env: - - name: TZ - value: "{{ .Values.globals.timezone }}" - - name: DB_CLIENT - value: pg - - name: DB_URL - valueFrom: - secretKeyRef: - name: "{{ .Release.Name }}-pg-connection" - key: url +{{ include "common.deployment" . }} diff --git a/apps/charts/reservoir/templates/service.yaml b/apps/charts/reservoir/templates/service.yaml index bb4d746..f024c64 100644 --- a/apps/charts/reservoir/templates/service.yaml +++ b/apps/charts/reservoir/templates/service.yaml @@ -1,16 +1 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Release.Name }}" - labels: - app: "{{ .Release.Name }}" -spec: - type: ClusterIP - ports: - - port: 80 - targetPort: 9111 - protocol: TCP - name: http - selector: - app: "{{ .Release.Name }}" - +{{ include "common.service" . }} diff --git a/apps/charts/reservoir/templates/virtual-service.yaml b/apps/charts/reservoir/templates/virtual-service.yaml index a9b195e..766f6b9 100644 --- a/apps/charts/reservoir/templates/virtual-service.yaml +++ b/apps/charts/reservoir/templates/virtual-service.yaml @@ -1,19 +1 @@ -apiVersion: networking.istio.io/v1 -kind: VirtualService -metadata: - name: "{{ .Release.Name }}-private" - namespace: "{{ .Release.Namespace }}" -spec: - gateways: - - "{{ .Values.globals.istio.gateways.private }}" - - mesh - hosts: - - "{{ .Values.subdomain }}.{{ .Values.globals.domain }}" - - mesh - http: - - route: - - destination: - host: "{{ .Release.Name }}" - port: - number: 80 - +{{ include "common.virtualService" . }} diff --git a/apps/charts/reservoir/values.yaml b/apps/charts/reservoir/values.yaml index b20671f..bf6ce83 100644 --- a/apps/charts/reservoir/values.yaml +++ b/apps/charts/reservoir/values.yaml @@ -2,4 +2,44 @@ image: repository: ghcr.io/morten-olsen/reservoir tag: main@sha256:8b5b91771ec4b66d725fcd29adc8cf40e280a0533dbb757db27c429afc272d39 pullPolicy: IfNotPresent + subdomain: reservoir + +# Deployment configuration +deployment: + strategy: RollingUpdate + replicas: 1 + +# Container configuration +container: + port: 9111 + healthProbe: + type: tcpSocket + port: http # Use named port + +# Service configuration +service: + port: 80 + type: ClusterIP + +# VirtualService configuration +virtualService: + enabled: true + gateways: + public: false + private: true + +# Database configuration +database: + enabled: true + +# Environment variables +env: + TZ: + value: "{timezone}" + DB_CLIENT: pg + DB_URL: + valueFrom: + secretKeyRef: + name: "{release}-connection" + key: url