From 97100ef140fd1c74595143edd31b2653d2c7eb56 Mon Sep 17 00:00:00 2001 From: Rohan Rustagi <110477025+RohanRusta21@users.noreply.github.com> Date: Tue, 4 Jul 2023 23:24:01 +0530 Subject: [PATCH 1/2] Create postgres-secret.yaml --- postgres-secret.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 postgres-secret.yaml diff --git a/postgres-secret.yaml b/postgres-secret.yaml new file mode 100644 index 0000000..08f5e99 --- /dev/null +++ b/postgres-secret.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: postgres-secret +type: Opaque +data: + POSTGRES_USER: cG9zdGdyZXM= # base64-encoded value for "postgres" + POSTGRES_PASSWORD: cG9zdGdyZXM= # base64-encoded value for "postgres" From d71fffccf649afb642c04ef525e2ffaebcb8f434 Mon Sep 17 00:00:00 2001 From: Rohan Rustagi <110477025+RohanRusta21@users.noreply.github.com> Date: Tue, 4 Jul 2023 23:25:03 +0530 Subject: [PATCH 2/2] Update postgres-deploy.yaml --- postgres-deploy.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/postgres-deploy.yaml b/postgres-deploy.yaml index e843226..c6d5aa5 100644 --- a/postgres-deploy.yaml +++ b/postgres-deploy.yaml @@ -26,8 +26,14 @@ spec: - containerPort: 5432 env: - name: POSTGRES_USER - value: "postgres" + valueFrom: + secretKeyRef: + name: postgres-secret + key: POSTGRES_USER - name: POSTGRES_PASSWORD - value: "postgres" + valueFrom: + secretKeyRef: + name: postgres-secret + key: POSTGRES_PASSWORD - name: POSTGRES_HOST_AUTH_METHOD value: trust