diff --git a/apps-kustomized/home-assistant/deploy.yaml b/apps-kustomized/home-assistant/deploy.yaml index e9ef031..92454a1 100644 --- a/apps-kustomized/home-assistant/deploy.yaml +++ b/apps-kustomized/home-assistant/deploy.yaml @@ -56,6 +56,33 @@ spec: name: config dnsPolicy: ClusterFirst enableServiceLinks: true + initContainers: + - command: + - /bin/sh + - -c + - | + PG_HOST=homeassistant-postgres + PG_DB=homeassistant + echo "psql_string: \"postgresql://${PG_USER}:${PG_PASS}@${PG_HOST}/${PG_DB}\"" > /config/secrets.yaml + env: + - name: PG_USER + valueFrom: + secretKeyRef: + key: username + name: homeassistant.homeassistant-postgres.credentials.postgresql.acid.zalan.do + - name: PG_PASS + valueFrom: + secretKeyRef: + key: password + name: homeassistant.homeassistant-postgres.credentials.postgresql.acid.zalan.do + image: alpine:latest + imagePullPolicy: Always + name: dbsecret + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /config + name: config restartPolicy: Always schedulerName: default-scheduler serviceAccount: default