forked from devopsyuva/kubernetes_latest_manifest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
postgresql-statefulset.yaml
46 lines (46 loc) · 976 Bytes
/
postgresql-statefulset.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: postgres-pv-claim
labels:
app: postgresdb
spec:
storageClassName: gp2
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 25Gi
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
spec:
replicas: 1
serviceName: postgres
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
terminationGracePeriodSeconds: 5
containers:
- name: postgres
image: postgres:latest
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 5432
envFrom:
- configMapRef:
name: postgres-config
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgredb-data
volumes:
- name: postgredb-data
persistentVolumeClaim:
claimName: postgres-pv-claim