add configDB.cong support with secret
Some checks are pending
Build Helm Chart / helm-package (pull_request) Waiting to run

This commit is contained in:
Marko Oldenburg 2024-10-11 10:04:30 +02:00
parent e53fe5afd3
commit 25c67b5329
4 changed files with 31 additions and 2 deletions

View File

@ -21,5 +21,5 @@ annotations:
category: Houseautomation category: Houseautomation
licenses: GPL'd licenses: GPL'd
type: application type: application
version: 1.0.1 version: 1.0.2
appVersion: "4.0.5-bullseye" appVersion: "4.0.5-bullseye"

View File

@ -57,6 +57,9 @@ spec:
- name: fhem-data - name: fhem-data
mountPath: /opt/fhem mountPath: /opt/fhem
subPath: fhem/ subPath: fhem/
- name: configdb-volume
mountPath: /opt/fhem/configDB.conf
subPath: fhem/configDB.conf
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
env: env:
@ -123,9 +126,14 @@ spec:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
volumes: volumes:
- name: fhem-data
{{- if .Values.persistence.enabled }} {{- if .Values.persistence.enabled }}
- name: fhem-data
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ include "fhem.fullname" . }} claimName: {{ include "fhem.fullname" . }}
{{- end }} {{- end }}
{{- if eq .Values.configtype "configDB" }}
- name: configdb-volume
secret:
secretName: {{ .Release.Name }}-db-config-secret
{{- end }}
restartPolicy: {{ .Values.restartPolicy }} restartPolicy: {{ .Values.restartPolicy }}

15
templates/secret.yaml Normal file
View File

@ -0,0 +1,15 @@
{{- if eq .Values.configtype "configDB" }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-db-config-secret
labels:
app: {{ .Release.Name }}
type: Opaque
data:
configDB.conf: |
{{- $connection := .Values.dbConfig.connection | quote }}
{{- $user := .Values.dbConfig.user | quote }}
{{- $password := .Values.dbConfig.password | quote }}
{{- printf "%%dbconfig= (\n connection => \"%s\",\n user => \"%s\",\n password => \"%s\"\n);" $connection $user $password | b64enc }}
{{- end }}

View File

@ -64,6 +64,12 @@ timezone: "Europe/Berlin"
configtype: "fhem.cfg.demo" configtype: "fhem.cfg.demo"
### ENDE Container environment variables ### ENDE Container environment variables
### if configtype configDB set, set the follow connection settings for a secret
dbConfig:
connection: ""
user: ""
password: ""
serviceAccount: serviceAccount:
# Specifies whether a service account should be created # Specifies whether a service account should be created
create: false create: false