-
Notifications
You must be signed in to change notification settings - Fork 1
/
sfs.yaml
43 lines (43 loc) · 973 Bytes
/
sfs.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
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgresql-sfs
spec:
selector:
matchLabels:
sfs: postgresql-sfs
serviceName: postgresql-svc
replicas: 3
template:
metadata:
labels:
sfs: postgresql-sfs
spec:
terminationGracePeriodSeconds: 10
containers:
- name: postgresql-db
image: postgres:13.3
env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgresql-secrets
key: POSTGRES_PASSWORD
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
ports:
- containerPort: 5432
name: postgresql-port
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
storageClassName: default
resources:
requests:
storage: 1Gi