35 lines
646 B
YAML
35 lines
646 B
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
labels:
|
|
app: db
|
|
name: db
|
|
namespace: vote
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: db
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: db
|
|
spec:
|
|
containers:
|
|
- image: postgres:9.4
|
|
name: postgres
|
|
env:
|
|
- name: POSTGRES_USER
|
|
value: postgres
|
|
- name: POSTGRES_PASSWORD
|
|
value: postgres
|
|
ports:
|
|
- containerPort: 5432
|
|
name: postgres
|
|
volumeMounts:
|
|
- mountPath: /var/lib/postgresql/data
|
|
name: db-data
|
|
volumes:
|
|
- name: db-data
|
|
emptyDir: {}
|