use config ref

This commit is contained in:
jem 2021-05-28 17:06:39 +02:00
parent 48be734cfc
commit 388ca2e50f
3 changed files with 8 additions and 3 deletions

View file

@ -5,6 +5,7 @@ metadata:
labels: labels:
app: postgres app: postgres
data: data:
postgres-db: keycloak
postgresql.conf: | postgresql.conf: |
max_connections = 1000 max_connections = 1000
shared_buffers = 512MB shared_buffers = 512MB

View file

@ -20,13 +20,15 @@ spec:
- name: POSTGRES_USER - name: POSTGRES_USER
value: "psql-user" value: "psql-user"
- name: POSTGRES_DB - name: POSTGRES_DB
value: "keycloak" valueFrom:
configMapKeyRef:
name: postgres-config
key: postgres-db
- name: POSTGRES_PASSWORD - name: POSTGRES_PASSWORD
value: "psql-pw" value: "psql-pw"
ports: ports:
- containerPort: 5432 - containerPort: 5432
name: postgresql name: postgresql
cmd:
volumeMounts: volumeMounts:
- name: postgres-config-volume - name: postgres-config-volume
mountPath: /etc/postgresql/postgresql.conf mountPath: /etc/postgresql/postgresql.conf

View file

@ -19,7 +19,9 @@
:name "postgresql" :name "postgresql"
:env :env
[{:name "POSTGRES_USER", :value "psqluser"} [{: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"}] {:name "POSTGRES_PASSWORD", :value "test1234"}]
:ports [{:containerPort 5432, :name "postgresql"}] :ports [{:containerPort 5432, :name "postgresql"}]
:cmd nil :cmd nil