Skip to content

Commit

Permalink
Set an explicit username/password for Postgres in the swarm and k8s f…
Browse files Browse the repository at this point in the history
…iles too
  • Loading branch information
Peter Valdez committed Feb 19, 2020
1 parent 7d1e4a9 commit e8e002b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docker-stack-simple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -78,4 +81,4 @@ networks:
backend:

volumes:
db-data:
db-data:
3 changes: 3 additions & 0 deletions docker-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions k8s-specifications/db-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions kube-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions result/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e8e002b

Please sign in to comment.