2021-06-08 17:20:43 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
name: postgres-config
|
|
|
|
labels:
|
|
|
|
app: postgres
|
|
|
|
data:
|
|
|
|
POSTGRES_PASSWORD: cae8xohrai5I
|
|
|
|
---
|
|
|
|
kind: PersistentVolumeClaim
|
|
|
|
apiVersion: v1
|
|
|
|
metadata:
|
|
|
|
name: postgres-pv-claim
|
|
|
|
labels:
|
|
|
|
app: postgres
|
|
|
|
spec:
|
2021-06-08 19:00:07 +00:00
|
|
|
accessModes:
|
|
|
|
- ReadWriteOnce
|
2021-06-08 17:20:43 +00:00
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: 5Gi
|
2021-06-08 19:56:49 +00:00
|
|
|
storageClassName: rook-cephfs
|
2021-06-08 17:20:43 +00:00
|
|
|
---
|
2021-06-08 19:00:07 +00:00
|
|
|
apiVersion: apps/v1
|
2021-06-08 17:20:43 +00:00
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: postgres
|
|
|
|
spec:
|
2021-06-08 19:00:07 +00:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: postgres
|
2021-06-08 17:20:43 +00:00
|
|
|
replicas: 1
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: postgres
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: postgres
|
|
|
|
image: postgres:13-alpine
|
|
|
|
ports:
|
|
|
|
- containerPort: 5432
|
|
|
|
envFrom:
|
|
|
|
- configMapRef:
|
|
|
|
name: postgres-config
|
|
|
|
volumeMounts:
|
2021-07-01 12:30:44 +00:00
|
|
|
- mountPath: /var/lib/postgresql
|
2021-06-08 17:20:43 +00:00
|
|
|
name: postgresdb
|
|
|
|
volumes:
|
|
|
|
- name: postgresdb
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: postgres-pv-claim
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: postgres
|
|
|
|
labels:
|
|
|
|
app: postgres
|
|
|
|
spec:
|
|
|
|
type: ClusterIP
|
|
|
|
ports:
|
|
|
|
- port: 5432
|
|
|
|
selector:
|
|
|
|
app: postgres
|