-
Notifications
You must be signed in to change notification settings - Fork 11
/
postgres-database-cfg.yaml
103 lines (103 loc) · 2.81 KB
/
postgres-database-cfg.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
kind: List
metadata: {}
apiVersion: v1
items:
# - apiVersion: image.openshift.io/v1
# kind: ImageStream
# metadata:
# name: postgresql-13-rhel7
# spec:
# lookupPolicy:
# local: true
# tags:
# - name: latest
# from:
# kind: DockerImage
# name: registry.redhat.io/rhscl/postgresql-13-rhel7:latest
# importPolicy: {}
# referencePolicy:
# type: Local
- apiVersion: v1
kind: Service
metadata:
name: postgresql
spec:
ports:
- name: postgresql
port: 5432
protocol: TCP
targetPort: 5432
selector:
name: postgresql
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pgsql-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
storageClassName: <default storage class name for cluster you are deploying on>
volumeMode: Filesystem
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: postgresql
spec:
replicas: 1
selector:
name: postgresql
strategy:
type: Recreate
template:
metadata:
labels:
name: postgresql
spec:
containers:
- env:
- name: POSTGRESQL_USER
value: <user-name>
- name: POSTGRESQL_PASSWORD
value: <password>
- name: POSTGRESQL_DATABASE
value: <database-name>
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
image: "quay.io/leihaochen/curator-postgresql-extension:13"
imagePullPolicy: IfNotPresent
# livenessProbe:
# exec:
# command:
# - /usr/libexec/check-container
# - --live
# initialDelaySeconds: 120
# timeoutSeconds: 10
name: postgresql
ports:
- containerPort: 5432
protocol: TCP
# readinessProbe:
# exec:
# command:
# - /usr/libexec/check-container
# initialDelaySeconds: 5
# timeoutSeconds: 1
resources:
requests:
cpu: "1"
memory: 2Gi
limits:
cpu: "1"
memory: 2Gi
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: pgsql-data
dnsPolicy: ClusterFirst
restartPolicy: Always
volumes:
- name: pgsql-data
persistentVolumeClaim:
claimName: pgsql-data