cf992f1d3b
As otherwise the VOLUME seems to override it
65 lines
1.1 KiB
YAML
65 lines
1.1 KiB
YAML
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:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 5Gi
|
|
storageClassName: rook-cephfs
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: postgres
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: postgres
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: postgres
|
|
spec:
|
|
containers:
|
|
- name: postgres
|
|
image: postgres:13-alpine
|
|
ports:
|
|
- containerPort: 5432
|
|
envFrom:
|
|
- configMapRef:
|
|
name: postgres-config
|
|
volumeMounts:
|
|
- mountPath: /var/lib/postgresql/data
|
|
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
|