-
Notifications
You must be signed in to change notification settings - Fork 26
/
example.yaml
280 lines (280 loc) · 6.35 KB
/
example.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
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: quotes
annotations:
openshift.io/display-name: Quotes Application
description: The Quotes application provides an HTTP API that returns a random, funny quote.
iconClass: icon-php
tags: php,mysql
objects:
- apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
annotations:
labels:
app: quotesapi
name: quotesapi
spec:
lookupPolicy:
local: false
- apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
annotations:
labels:
app: quotesapi
name: quotesapi
spec:
failedBuildsHistoryLimit: 5
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: quotesapi:latest
postCommit: {}
resources: {}
runPolicy: Serial
source:
contextDir: /
git:
uri: ${APP_GIT_URL}
type: Git
strategy:
sourceStrategy:
from:
kind: ImageStreamTag
name: php:7.2
namespace: openshift
type: Source
successfulBuildsHistoryLimit: 5
triggers:
- github:
secret: ${SECRET}
type: GitHub
- generic:
secret: ${SECRET}
type: Generic
- type: ConfigChange
- imageChange:
type: ImageChange
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
annotations:
labels:
app: quotesapi
name: quotesapi
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
app: quotesapi
deploymentconfig: quotesapi
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
annotations:
labels:
app: quotesapi
deploymentconfig: quotesapi
spec:
containers:
- env:
- name: DATABASE_NAME
value: quotesdb
- name: DATABASE_PASSWORD
value: ${PASSWORD}
- name: DATABASE_SERVICE_NAME
value: quotesdb
- name: DATABASE_USER
value: quoteapp
imagePullPolicy: Always
name: quotesapi
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8443
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- quotesapi
from:
kind: ImageStreamTag
name: quotesapi:latest
type: ImageChange
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
annotations:
labels:
app: quotesdb
name: quotesdb
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
app: quotesdb
deploymentconfig: quotesdb
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
annotations:
labels:
app: quotesdb
deploymentconfig: quotesdb
spec:
containers:
- env:
- name: MYSQL_DATABASE
value: quotesdb
- name: MYSQL_PASSWORD
value: ${PASSWORD}
- name: MYSQL_USER
value: quoteapp
imagePullPolicy: IfNotPresent
name: quotesdb
ports:
- containerPort: 3306
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/lib/mysql/data
name: quotesdb-volume-1
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: quotesdb-volume-1
persistentVolumeClaim:
claimName: quotesdb-claim
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- quotesdb
from:
kind: ImageStreamTag
name: mysql:5.7
namespace: openshift
type: ImageChange
- apiVersion: v1
kind: Service
metadata:
annotations:
labels:
app: quotesapi
name: quotesapi
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
- name: 8443-tcp
port: 8443
protocol: TCP
targetPort: 8443
selector:
app: quotesapi
deploymentconfig: quotesapi
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: Service
metadata:
annotations:
labels:
app: quotesdb
name: quotesdb
spec:
ports:
- name: 3306-tcp
port: 3306
protocol: TCP
targetPort: 3306
selector:
app: quotesdb
deploymentconfig: quotesdb
sessionAffinity: None
type: ClusterIP
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
annotations:
labels:
app: quotesapi
name: quotesapi
spec:
port:
targetPort: 8080-tcp
to:
kind: Service
name: quotesapi
weight: 100
wildcardPolicy: None
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
name: quotesdb-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 300Mi
storageClassName: gp2
volumeMode: Filesystem
parameters:
- name: APP_GIT_URL
displayName: Application Source Git URL
description: The Git URL of the application source code
required: true
value: https://github.com/tsrana/php-quotes
- name: PASSWORD
displayName: Database Password
description: Password to access the database
generate: expression
from: '[a-zA-Z0-9]{16}'
- name: SECRET
displayName: Webhook Secret
description: Secret for webhooks
generate: expression
from: '[a-zA-Z0-9]{40}'