You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: postgresql
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: postgresql
|
|
strategy:
|
|
type: Recreate
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: postgresql
|
|
spec:
|
|
containers:
|
|
- image: postgres:13
|
|
name: postgresql
|
|
env:
|
|
- name: POSTGRES_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: postgres-secret
|
|
key: postgres-user
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: postgres-secret
|
|
key: postgres-password
|
|
- name: POSTGRES_DB
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: postgres-config
|
|
key: postgres-db
|
|
ports:
|
|
- containerPort: 5432
|
|
name: postgresql
|
|
volumeMounts:
|
|
- name: postgres-config-volume
|
|
mountPath: /etc/postgresql/postgresql.conf
|
|
subPath: postgresql.conf
|
|
readOnly: true
|
|
- name: postgre-data-volume
|
|
mountPath: /var/lib/postgresql/data
|
|
volumes:
|
|
- name: postgres-config-volume
|
|
configMap:
|
|
name: postgres-config
|
|
- name: postgre-data-volume
|
|
persistentVolumeClaim:
|
|
claimName: postgres-claim
|