From 388ca2e50f16fe02bdb22e7e4e39d7b472919195 Mon Sep 17 00:00:00 2001 From: jem Date: Fri, 28 May 2021 17:06:39 +0200 Subject: [PATCH] use config ref --- src/main/resources/postgres/config.yaml | 1 + src/main/resources/postgres/deployment.yaml | 6 ++++-- src/test/cljc/dda/k8s_keycloak/postgres_test.cljc | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/resources/postgres/config.yaml b/src/main/resources/postgres/config.yaml index 799cc45..4006743 100644 --- a/src/main/resources/postgres/config.yaml +++ b/src/main/resources/postgres/config.yaml @@ -5,6 +5,7 @@ metadata: labels: app: postgres data: + postgres-db: keycloak postgresql.conf: | max_connections = 1000 shared_buffers = 512MB diff --git a/src/main/resources/postgres/deployment.yaml b/src/main/resources/postgres/deployment.yaml index 143d376..9b9578a 100644 --- a/src/main/resources/postgres/deployment.yaml +++ b/src/main/resources/postgres/deployment.yaml @@ -20,13 +20,15 @@ spec: - name: POSTGRES_USER value: "psql-user" - name: POSTGRES_DB - value: "keycloak" + valueFrom: + configMapKeyRef: + name: postgres-config + key: postgres-db - name: POSTGRES_PASSWORD value: "psql-pw" ports: - containerPort: 5432 name: postgresql - cmd: volumeMounts: - name: postgres-config-volume mountPath: /etc/postgresql/postgresql.conf diff --git a/src/test/cljc/dda/k8s_keycloak/postgres_test.cljc b/src/test/cljc/dda/k8s_keycloak/postgres_test.cljc index 26e8e83..5ccf16c 100644 --- a/src/test/cljc/dda/k8s_keycloak/postgres_test.cljc +++ b/src/test/cljc/dda/k8s_keycloak/postgres_test.cljc @@ -19,7 +19,9 @@ :name "postgresql" :env [{:name "POSTGRES_USER", :value "psqluser"} - {:name "POSTGRES_DB", :value "keycloak"} + {:name "POSTGRES_DB", :valueFrom + {:configMapKeyRef + {:name "postgres-config", :key "postgres-db"}}} {:name "POSTGRES_PASSWORD", :value "test1234"}] :ports [{:containerPort 5432, :name "postgresql"}] :cmd nil