From daf0ea21bbe8653c6250871431d56adf2cfbcce4 Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Fri, 1 Aug 2025 14:47:53 +0200 Subject: [PATCH] update --- chart/templates/deployment.yaml | 61 +++++++++++++++++++++++++++++++++ chart/values.yaml | 50 +++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index c44c51e..b8aa1d6 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -31,6 +31,67 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + # PostgreSQL Host + - name: POSTGRES_HOST + {{- if .Values.config.postgres.host.fromSecret.enabled }} + valueFrom: + secretKeyRef: + name: {{ .Values.config.postgres.host.fromSecret.secretName }} + key: {{ .Values.config.postgres.host.fromSecret.key }} + {{- else }} + value: {{ .Values.config.postgres.host.value | quote }} + {{- end }} + # PostgreSQL Port + - name: POSTGRES_PORT + {{- if .Values.config.postgres.port.fromSecret.enabled }} + valueFrom: + secretKeyRef: + name: {{ .Values.config.postgres.port.fromSecret.secretName }} + key: {{ .Values.config.postgres.port.fromSecret.key }} + {{- else }} + value: {{ .Values.config.postgres.port.value | quote }} + {{- end }} + # PostgreSQL User + - name: POSTGRES_USER + {{- if .Values.config.postgres.user.fromSecret.enabled }} + valueFrom: + secretKeyRef: + name: {{ .Values.config.postgres.user.fromSecret.secretName }} + key: {{ .Values.config.postgres.user.fromSecret.key }} + {{- else }} + value: {{ .Values.config.postgres.user.value | quote }} + {{- end }} + # PostgreSQL Password + - name: POSTGRES_PASSWORD + {{- if .Values.config.postgres.password.fromSecret.enabled }} + valueFrom: + secretKeyRef: + name: {{ .Values.config.postgres.password.fromSecret.secretName }} + key: {{ .Values.config.postgres.password.fromSecret.key }} + {{- else }} + value: {{ .Values.config.postgres.password.value | quote }} + {{- end }} + # Certificate Manager + - name: CERT_MANAGER + {{- if .Values.config.certManager.fromSecret.enabled }} + valueFrom: + secretKeyRef: + name: {{ .Values.config.certManager.fromSecret.secretName }} + key: {{ .Values.config.certManager.fromSecret.key }} + {{- else }} + value: {{ .Values.config.certManager.value | quote }} + {{- end }} + # Istio Gateway + - name: ISTIO_GATEWAY + {{- if .Values.config.istioGateway.fromSecret.enabled }} + valueFrom: + secretKeyRef: + name: {{ .Values.config.istioGateway.fromSecret.secretName }} + key: {{ .Values.config.istioGateway.fromSecret.key }} + {{- else }} + value: {{ .Values.config.istioGateway.value | quote }} + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/chart/values.yaml b/chart/values.yaml index 4346698..f15b893 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -51,3 +51,53 @@ nodeSelector: {} tolerations: [] affinity: {} + +# Configuration for the homelab operator +config: + # PostgreSQL database configuration + postgres: + host: + # Direct value (used when fromSecret.enabled is false) + value: "127.0.0.1" + # Secret reference (used when fromSecret.enabled is true) + fromSecret: + enabled: false + secretName: "" + key: "POSTGRES_HOST" + + port: + value: "5432" + fromSecret: + enabled: false + secretName: "" + key: "POSTGRES_PORT" + + user: + value: "postgres" + fromSecret: + enabled: false + secretName: "" + key: "POSTGRES_USER" + + password: + value: "" + fromSecret: + enabled: true # Default to secret for sensitive data + secretName: "postgres-secret" + key: "POSTGRES_PASSWORD" + + # Certificate manager configuration + certManager: + value: "letsencrypt-prod" + fromSecret: + enabled: false + secretName: "" + key: "CERT_MANAGER" + + # Istio gateway configuration + istioGateway: + value: "istio-ingress" + fromSecret: + enabled: false + secretName: "" + key: "ISTIO_GATEWAY"