From e8e002bb234fac89927c62a909ce5398075e9d3b Mon Sep 17 00:00:00 2001 From: Peter Valdez Date: Wed, 19 Feb 2020 14:54:19 -0500 Subject: [PATCH] Set an explicit username/password for Postgres in the swarm and k8s files too --- docker-stack-simple.yml | 5 ++++- docker-stack.yml | 3 +++ k8s-specifications/db-deployment.yaml | 5 +++++ kube-deployment.yml | 4 ++++ result/docker-compose.test.yml | 3 +++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docker-stack-simple.yml b/docker-stack-simple.yml index 8189386..04f5dd9 100644 --- a/docker-stack-simple.yml +++ b/docker-stack-simple.yml @@ -16,6 +16,9 @@ services: condition: on-failure db: image: postgres:9.4 + environment: + POSTGRES_USER: "postgres" + POSTGRES_PASSWORD: "postgres" volumes: - db-data:/var/lib/postgresql/data networks: @@ -78,4 +81,4 @@ networks: backend: volumes: - db-data: \ No newline at end of file + db-data: diff --git a/docker-stack.yml b/docker-stack.yml index c7ffa76..e80f8c2 100644 --- a/docker-stack.yml +++ b/docker-stack.yml @@ -14,6 +14,9 @@ services: condition: on-failure db: image: postgres:9.4 + environment: + POSTGRES_USER: "postgres" + POSTGRES_PASSWORD: "postgres" volumes: - db-data:/var/lib/postgresql/data networks: diff --git a/k8s-specifications/db-deployment.yaml b/k8s-specifications/db-deployment.yaml index f552a75..55622bb 100644 --- a/k8s-specifications/db-deployment.yaml +++ b/k8s-specifications/db-deployment.yaml @@ -18,6 +18,11 @@ spec: containers: - image: postgres:9.4 name: postgres + env: + - name: POSTGRES_USER + value: postgres + - name: POSTGRES_PASSWORD + value: postgres ports: - containerPort: 5432 name: postgres diff --git a/kube-deployment.yml b/kube-deployment.yml index e56956c..c567e38 100644 --- a/kube-deployment.yml +++ b/kube-deployment.yml @@ -77,6 +77,10 @@ spec: env: - name: PGDATA value: /var/lib/postgresql/data/pgdata + - name: POSTGRES_USER + value: postgres + - name: POSTGRES_PASSWORD + value: postgres ports: - containerPort: 5432 name: db diff --git a/result/docker-compose.test.yml b/result/docker-compose.test.yml index 0df964e..42e15e4 100644 --- a/result/docker-compose.test.yml +++ b/result/docker-compose.test.yml @@ -47,6 +47,9 @@ services: db: image: postgres:9.4 + environment: + POSTGRES_USER: "postgres" + POSTGRES_PASSWORD: "postgres" volumes: - "db-data:/var/lib/postgresql/data" networks: