-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenshift-template.yaml
289 lines (289 loc) · 7.57 KB
/
openshift-template.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
kind: "Template"
metadata:
name: cross-sections-template
apiVersion: "v1"
parameters:
- name: DEPLOY_KEY
displayName: Wrf cross section deploy key.
description: SSH private key for pulling source code.
required: true
- name: PATH
displayName: Path to append to domain for app.
required: true
value: /cross-sections
- name: WRF_DATA_DIR
displayName: Wrf data directory.
description: The directory to find wrf data in.
required: true
- name: REPO_TAG
description: Tag or branch of repository to use.
value: master
required: true
- name: STAGE
displayName: Stage of Life (development, test, production).
required: true
value: production
- name: ROUTE
displayName: Domain route for app.
- name: TAG
displayName: Image stream tag.
required: true
value: stable
- name: GITHUB_WEBHOOK_SECRET
description: Secret string to configure the Github Webhook
generate: expression
from: "[a-zA-Z0-9]{20}"
- name: HTPASSWD
description: htpasswd file for nginx authentication.
required: true
objects:
- apiVersion: v1
kind: Secret
metadata:
name: cross-sections-auth
stringData:
.htpasswd: '{$HTPASSWD}'
- apiVersion: v1
kind: Secret
metadata:
name: cross-sections-dk
type: kubernetes.io/ssh-auth
data:
ssh-privatekey: "${{DEPLOY_KEY}}"
- apiVersion: v1
kind: ImageStream
metadata:
name: cross-sections-bokeh
annotations:
openshift.io/display-name: cross-sections-bokeh
openshift.io/descriptions: Wrf cross section bokeh application.
labels:
image: cross-sections
tier: frontend
- apiVersion: v1
kind: ImageStream
metadata:
name: cross-sections-nginx
annotations:
openshift.io/display-name: cross-sections-nginx
openshoft.io/descriptions: Wrf cross sections nginx server.
labels:
image: cross-sections
tier: webserver
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: cross-sections
tier: frontend
name: cross-sections-bokeh
spec:
runPolicy: Serial
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: cross-sections-bokeh:latest
postCommit: {}
resources: {}
source:
git:
ref: "${REPO_TAG}"
uri: [email protected]:UARENForecasting/wrf-cross-section.git
sourceSecret:
name: cross-sections-dk
type: Git
strategy:
sourceStrategy:
from:
kind: "ImageStreamTag"
name: "fxpython-s2i:latest"
triggers:
- type: "GitHub"
github:
secret: "${GITHUB_WEBHOOK_SECRET}"
- type: ConfigChange
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: cross-sections
tier: webserver
name: cross-sections-nginx
spec:
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: cross-sections-nginx:latest
postCommit: {}
resources: {}
runPolicy: Serial
source:
git:
ref: "${REPO_TAG}"
uri: [email protected]:UARENForecasting/wrf-cross-section.git
sourceSecret:
name: cross-sections-dk
type: Git
strategy:
sourceStrategy:
env:
- name: "NGINX_SERVER_CONF_FILE"
value: "./nginx.conf"
from:
kind: "ImageStreamTag"
name: "nginx-s2i:latest"
triggers:
- type: "GitHub"
github:
secret: "${GITHUB_WEBHOOK_SECRET}"
- type: ConfigChange
- apiVersion: v1
kind: Service
metadata:
labels:
app: cross-sections
age: "${STAGE}"
name: "cross-sections-${STAGE}"
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: cross-sections
age: "${STAGE}"
sessionAffinity: None
- apiVersion: v1
kind: Route
metadata:
name: "cross-sections-${STAGE}"
labels:
app: cross-sections
age: "${STAGE}"
spec:
host: "${ROUTE}"
path: "${PATH}"
to:
kind: Service
name: "cross-sections-${STAGE}"
port:
targetPort: 8080-tcp
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
- apiVersion: v1
kind: DeploymentConfig
metadata:
generation: 1
labels:
app: cross-sections
age: "${STAGE}"
name: "cross-sections-${STAGE}"
spec:
replicas: 1
selector:
app: cross-sections
age: "${STAGE}"
strategy:
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
labels:
app: cross-sections
age: "${STAGE}"
spec:
containers:
- name: cross-sections-bokeh
env:
- name: APP_SCRIPT
value: ./run
- name: MYSQL_CREDS
value: /auth/.mysql
- name: WRF_DATA_DIRECTORY
value: "${WRF_DATA_DIR}"
image: cross-sections-bokeh:${TAG}
imagePullPolicy: Always
ports:
- containerPort: 5006
protocol: TCP
resources: {}
livenessProbe:
tcpSocket:
port: 5006
initialDelaySeconds: 1
timeoutSeconds: 10
readinessProbe:
tcpSocket:
port: 5006
initialDelaySeconds: 1
timeoutSeconds: 30
periodSeconds: 30
terminationMessagePath: /dev/termination-log
volumeMounts:
- mountPath: "/auth"
name: "mysqlauth"
- mountPath: "/a4"
name: "a4"
- name: cross-sections-nginx
image: cross-sections-nginx:${TAG}
imagePullPolicy: Always
env:
- name: BASE_PATH
value: "${PATH}"
- name: BEFORE_NGINX
value: /opt/app-root/etc/aux/fix_nginx_config
ports:
- containerPort: 8080
protocol: TCP
resources: {}
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 1
timeoutSeconds: 5
volumeMounts:
- mountPath: "/auth"
name: "nginxauth"
volumes:
- name: "mysqlauth"
secret:
defaultMode: 420
secretName: "mysql-selectonly-auth"
- name: "a4"
persistentVolumeClaim:
claimName: "a4"
- name: "nginxauth"
secret:
defaultMode: 420
secretName: "cross-sections-auth"
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- cross-sections-nginx
from:
kind: ImageStreamTag
name: "cross-sections-nginx:${TAG}"
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- cross-sections-bokeh
from:
kind: ImageStreamTag
name: "cross-sections-bokeh:${TAG}"