-
Notifications
You must be signed in to change notification settings - Fork 35
/
opa-db-statefulset.yaml
61 lines (61 loc) 路 1.61 KB
/
opa-db-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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: opa-db-statefulset
namespace: hm-opa
spec:
serviceName: "opa-db-service"
replicas: 1
selector:
matchLabels:
component: opa-db
template:
metadata:
labels:
component: opa-db
spec:
containers:
- name: opa-db
image: postgres:13.3-alpine
env:
- name: PGDATA
valueFrom:
configMapKeyRef:
name: opa-db-configmap
key: pgdata
- name: POSTGRES_DB
valueFrom:
configMapKeyRef:
name: opa-db-configmap
key: postgres_db
- name: POSTGRES_USER
valueFrom:
configMapKeyRef:
name: opa-db-configmap
key: postgres_user
- name: POSTGRES_PASSWORD
valueFrom:
configMapKeyRef:
name: opa-db-configmap
key: postgres_password
ports:
- name: postgres
protocol: TCP
containerPort: 5432
volumeMounts:
- name: opa-db-volume
mountPath: /var/lib/postgresql/data
- name: opa-db-sql-volume
mountPath: /docker-entrypoint-initdb.d
volumes:
- name: opa-db-sql-volume
persistentVolumeClaim:
claimName: opa-db-sql-pvc
volumeClaimTemplates:
- metadata:
name: opa-db-volume
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi