deployment/templates/postgresql_deployment.yaml

63 lines
1.3 KiB
YAML
Raw Normal View History

2021-04-20 00:36:44 +02:00
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: job-orchestrator-postgres-pvc
spec:
storageClassName: longhorn
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: job-orchestrator-postgres
spec:
replicas: 1
selector:
matchLabels:
app: job-orchestrator-postgres
template:
metadata:
labels:
app: job-orchestrator-postgres
spec:
2021-04-20 01:34:48 +02:00
volumes:
- name: data
persistentVolumeClaim:
claimName: job-orchestrator-postgres-pvc
2021-04-20 00:36:44 +02:00
containers:
- name: job-orchestrator-postgres
2021-04-20 01:51:37 +02:00
image: "postgres:13"
2021-04-20 00:36:44 +02:00
envFrom:
- configMapRef:
name: job-orchestrator-postgres-config
volumeMounts:
2021-04-20 01:56:16 +02:00
- mountPath: /var/lib/postgresql
2021-04-20 01:34:48 +02:00
name: data
2021-04-20 00:36:44 +02:00
---
apiVersion: v1
kind: Service
metadata:
name: job-orchestrator-postgres-service
spec:
selector:
app: job-orchestrator-postgres
ports:
- name: job-orchestrator-postgres
protocol: TCP
port: 5432
targetPort: 5432
---
apiVersion: v1
kind: ConfigMap
metadata:
name: job-orchestrator-postgres-config
data:
POSTGRES_PASSWORD: "joborchestratorpostgressupersecret"
POSTGRES_USER: "joborchestrator"
POSTGRES_DB: "joborchestrator"