-
Notifications
You must be signed in to change notification settings - Fork 5
/
postgresql.dc.yaml
168 lines (168 loc) · 5.23 KB
/
postgresql.dc.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
---
kind: Template
apiVersion: template.openshift.io/v1
metadata:
name: nrmlimesurvey-postgresql-dc
parameters:
- description: The short-name of the Survey Service, lower-case with hyphen.
displayName: Survey Name
name: SURVEY_NAME
required: true
value: mds
- description: Maximum amount of memory the container can use.
displayName: Memory Limit
name: MEMORY_LIMIT
required: true
value: 512Mi
- description: Password for the PostgreSQL connection user.
displayName: PostgreSQL Connection Password
from: "[a-zA-Z0-9]{16}"
generate: expression
name: POSTGRESQL_PASSWORD
required: true
- description: Volume space available for data, e.g. 512Mi, 2Gi.
displayName: Database Volume Capacity
name: DB_VOLUME_CAPACITY
required: true
value: 1Gi
objects:
- kind: Secret
apiVersion: v1
metadata:
name: "${SURVEY_NAME}limesurvey-postgresql"
labels:
app: "${SURVEY_NAME}limesurvey"
annotations:
description: Database credentials and name.
template.openshift.io/expose-database_name: "{.data['database-name']}"
template.openshift.io/expose-password: "{.data['database-password']}"
template.openshift.io/expose-username: "{.data['database-user']}"
stringData:
database-name: "${SURVEY_NAME}"
database-password: "${POSTGRESQL_PASSWORD}"
database-user: "${SURVEY_NAME}"
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: "${SURVEY_NAME}limesurvey-postgresql"
labels:
app: "${SURVEY_NAME}limesurvey"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "${DB_VOLUME_CAPACITY}"
storageClassName: netapp-block-standard
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: "${SURVEY_NAME}limesurvey-postgresql"
labels:
app: "${SURVEY_NAME}limesurvey"
annotations: {}
spec:
strategy:
type: Recreate
recreateParams:
timeoutSeconds: 600
resources: {}
activeDeadlineSeconds: 21600
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- "${SURVEY_NAME}limesurvey-postgresql"
from:
kind: ImageStreamTag
namespace: openshift
name: postgresql:12
replicas: 1
revisionHistoryLimit: 10
test: false
selector:
app: "${SURVEY_NAME}limesurvey"
deploymentconfig: "${SURVEY_NAME}limesurvey-postgresql"
template:
metadata:
creationTimestamp:
labels:
app: "${SURVEY_NAME}limesurvey"
deploymentconfig: "${SURVEY_NAME}limesurvey-postgresql"
annotations: {}
spec:
volumes:
- name: postgresql-volume
persistentVolumeClaim:
claimName: "${SURVEY_NAME}limesurvey-postgresql"
containers:
- name: "${SURVEY_NAME}limesurvey-postgresql"
image: " "
ports:
- containerPort: 5432
protocol: TCP
env:
- name: POSTGRESQL_DATABASE
valueFrom:
secretKeyRef:
name: "${SURVEY_NAME}limesurvey-postgresql"
key: database-name
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
name: "${SURVEY_NAME}limesurvey-postgresql"
key: database-password
- name: POSTGRESQL_USER
valueFrom:
secretKeyRef:
name: "${SURVEY_NAME}limesurvey-postgresql"
key: database-user
resources:
limits:
memory: "${MEMORY_LIMIT}"
volumeMounts:
- name: postgresql-volume
mountPath: "/var/lib/pgsql/data"
livenessProbe:
initialDelaySeconds: 30
tcpSocket:
port: 5432
timeoutSeconds: 1
readinessProbe:
exec:
command:
- "/bin/bash"
- "-c"
- pg_isready -h localhost -p 5432
initialDelaySeconds: 20
timeoutSeconds: 1
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: File
imagePullPolicy: Always
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
- kind: Service
apiVersion: v1
metadata:
name: "${SURVEY_NAME}limesurvey-postgresql"
labels:
app: "${SURVEY_NAME}limesurvey"
annotations: {}
spec:
ports:
- name: 5432-tcp
protocol: TCP
port: 5432
targetPort: 5432
selector:
app: "${SURVEY_NAME}limesurvey"
deploymentconfig: "${SURVEY_NAME}limesurvey-postgresql"
type: ClusterIP
sessionAffinity: None
status:
loadBalancer: {}