-
Notifications
You must be signed in to change notification settings - Fork 0
/
statefulset.yml
55 lines (55 loc) · 1.3 KB
/
statefulset.yml
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
47
48
49
50
51
52
53
54
55
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
spec:
selector:
matchLabels:
app: postgres
serviceName: postgres
replicas: 1
template:
metadata:
labels:
app: postgres
spec:
terminationGracePeriodSeconds: 10
containers:
- name: postgres
image: arm32v7/postgres:10.3
ports:
- containerPort: 5432
name: psql
env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: pg-secrets
key: PG_PASSWORD
- name: POSTGRES_USER
valueFrom:
configMapKeyRef:
name: pg-config-data
key: pg.user
- name: POSTGRES_DB
valueFrom:
configMapKeyRef:
name: pg-config-data
key: pg.db
- name: POSTGRES_DATA
valueFrom:
configMapKeyRef:
name: pg-config-data
key: pg.data
volumeMounts:
- name: pg-data
mountPath: /var/lib/postgresql/data
volumeClaimTemplates:
- metadata:
name: pg-data
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "local-storage"
resources:
requests:
storage: 1Gi