fix backup credentials

This commit is contained in:
jerger 2022-04-02 17:26:02 +02:00
parent a224506caa
commit 6b6cc630c6
2 changed files with 33 additions and 13 deletions

View file

@ -6,8 +6,8 @@ metadata:
app.kubernetes.part-of: cloud app.kubernetes.part-of: cloud
spec: spec:
schedule: "10 23 * * *" schedule: "10 23 * * *"
successfulJobsHistoryLimit: 0 successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 0 failedJobsHistoryLimit: 1
jobTemplate: jobTemplate:
spec: spec:
template: template:
@ -18,12 +18,21 @@ spec:
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
command: ["/entrypoint.sh"] command: ["/entrypoint.sh"]
env: env:
- name: POSTGRES_USER_FILE - name: POSTGRES_USER
value: /var/run/secrets/cloud-secrets/postgres-user valueFrom:
- name: POSTGRES_DB_FILE secretKeyRef:
value: /var/run/secrets/cloud-secrets/postgres-db name: postgres-secret
- name: POSTGRES_PASSWORD_FILE key: postgres-user
value: /var/run/secrets/cloud-secrets/postgres-password - name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-secret
key: postgres-password
- name: POSTGRES_DB
valueFrom:
configMapKeyRef:
name: postgres-config
key: postgres-db
- name: POSTGRES_HOST - name: POSTGRES_HOST
value: "postgresql-service:5432" value: "postgresql-service:5432"
- name: POSTGRES_SERVICE - name: POSTGRES_SERVICE

View file

@ -30,8 +30,8 @@
:metadata {:name "cloud-backup", :labels {:app.kubernetes.part-of "cloud"}} :metadata {:name "cloud-backup", :labels {:app.kubernetes.part-of "cloud"}}
:spec :spec
{:schedule "10 23 * * *" {:schedule "10 23 * * *"
:successfulJobsHistoryLimit 0 :successfulJobsHistoryLimit 1
:failedJobsHistoryLimit 0 :failedJobsHistoryLimit 1
:jobTemplate :jobTemplate
{:spec {:spec
{:template {:template
@ -42,9 +42,20 @@
:imagePullPolicy "IfNotPresent" :imagePullPolicy "IfNotPresent"
:command ["/entrypoint.sh"] :command ["/entrypoint.sh"]
:env :env
[{:name "POSTGRES_USER_FILE", :value "/var/run/secrets/cloud-secrets/postgres-user"} [{:valueFrom
{:name "POSTGRES_DB_FILE", :value "/var/run/secrets/cloud-secrets/postgres-db"} {:secretKeyRef
{:name "POSTGRES_PASSWORD_FILE", :value "/var/run/secrets/cloud-secrets/postgres-password"} {:name "postgres-secret",
:key "postgres-user"}},
:name "POSTGRES_USER"}
{:valueFrom
{:secretKeyRef
{:name "postgres-secret",
:key "postgres-password"}},
:name "POSTGRES_PASSWORD"}
{:valueFrom
{:configMapKeyRef
{:name "postgres-config", :key "postgres-db"}},
:name "POSTGRES_DB"}
{:name "POSTGRES_HOST", :value "postgresql-service:5432"} {:name "POSTGRES_HOST", :value "postgresql-service:5432"}
{:name "POSTGRES_SERVICE", :value "postgresql-service"} {:name "POSTGRES_SERVICE", :value "postgresql-service"}
{:name "POSTGRES_PORT", :value "5432"} {:name "POSTGRES_PORT", :value "5432"}