-
Notifications
You must be signed in to change notification settings - Fork 7
/
postgresql.dc.yaml
167 lines (167 loc) · 5.15 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
---
kind: Template
apiVersion: template.openshift.io/v1
message: A new PostgreSQL application has been created in your project
metadata:
name: nrmfeedback-postgresql-dc
parameters:
- description: The short-name of the Feedback Service, lower-case with hyphen.
displayName: Feedback Name
name: FEEDBACK_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: 2Gi
objects:
- kind: Secret
apiVersion: v1
metadata:
name: "${FEEDBACK_NAME}-postgresql"
labels:
app: "${FEEDBACK_NAME}"
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: "${FEEDBACK_NAME}"
database-password: "${POSTGRESQL_PASSWORD}"
database-user: "${FEEDBACK_NAME}"
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: "${FEEDBACK_NAME}-postgresql"
labels:
app: "${FEEDBACK_NAME}"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "${DB_VOLUME_CAPACITY}"
storageClassName: netapp-file-standard
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: "${FEEDBACK_NAME}-postgresql"
labels:
app: "${FEEDBACK_NAME}"
annotations: {}
spec:
strategy:
type: Recreate
recreateParams:
timeoutSeconds: 600
resources: {}
activeDeadlineSeconds: 21600
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- "${FEEDBACK_NAME}-postgresql"
from:
kind: ImageStreamTag
namespace: openshift
name: postgresql:9.6
replicas: 1
revisionHistoryLimit: 10
test: false
selector:
app: "${FEEDBACK_NAME}"
deploymentconfig: "${FEEDBACK_NAME}-postgresql"
template:
metadata:
creationTimestamp:
labels:
app: "${FEEDBACK_NAME}"
deploymentconfig: "${FEEDBACK_NAME}-postgresql"
annotations: {}
spec:
volumes:
- name: postgresql-volume
persistentVolumeClaim:
claimName: "${FEEDBACK_NAME}-postgresql"
containers:
- name: "${FEEDBACK_NAME}-postgresql"
image: image-registry.openshift-image-registry.svc:5000/openshift/postgresql:9
ports:
- containerPort: 5432
protocol: TCP
env:
- name: POSTGRESQL_DATABASE
valueFrom:
secretKeyRef:
name: "${FEEDBACK_NAME}-postgresql"
key: database-name
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
name: "${FEEDBACK_NAME}-postgresql"
key: database-password
- name: POSTGRESQL_USER
valueFrom:
secretKeyRef:
name: "${FEEDBACK_NAME}-postgresql"
key: database-user
resources: {}
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: 15
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: File
imagePullPolicy: Always
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
- kind: Service
apiVersion: v1
metadata:
name: "${FEEDBACK_NAME}-postgresql"
labels:
app: "${FEEDBACK_NAME}"
annotations: {}
spec:
ports:
- name: 5432-tcp
protocol: TCP
port: 5432
targetPort: 5432
selector:
app: "${FEEDBACK_NAME}"
deploymentconfig: "${FEEDBACK_NAME}-postgresql"
type: ClusterIP
sessionAffinity: None
status:
loadBalancer: {}