uek-109-LBb/deployment/database.yaml

57 lines
1.3 KiB
YAML
Raw Normal View History

2024-07-02 10:54:15 +02:00
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: counter-database
spec:
replicas: 1
selector:
matchLabels:
app: counter-database
template:
metadata:
labels:
app: counter-database
spec:
containers:
- name: counter-database
image: quay.io/centos7/postgresql-10-centos7:20221109
imagePullPolicy: Always
ports:
- containerPort: 5432
env:
- name: POSTGRESQL_USER
valueFrom:
secretKeyRef:
name: counter-database
key: database-user
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
name: counter-database
key: database-password
- name: POSTGRESQL_DATABASE
valueFrom:
secretKeyRef:
name: counter-database
key: database-name
2024-07-02 14:09:47 +02:00
volumeMounts:
- name: postgresql-data
mountPath: /var/lib/pgsql/data
volumes:
- name: postgresql-data
persistentVolumeClaim:
claimName: counter-database-pvc
2024-07-02 10:54:15 +02:00
---
apiVersion: v1
kind: Service
metadata:
name: counter-database
spec:
selector:
app: counter-database
ports:
- protocol: TCP
port: 5432
2024-07-02 14:09:47 +02:00
targetPort: 5432