-
Notifications
You must be signed in to change notification settings - Fork 2
/
wildfly-thorntail-s2i-template-dev.yaml
396 lines (365 loc) · 9.99 KB
/
wildfly-thorntail-s2i-template-dev.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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
##comienzo Template
apiVersion: v1
kind: Template
metadata:
name: wildlfy-thorntail-s2i-mvilche
labels:
template: wildlfy-thorntail-s2i-mvilche
autor: "Martin_Fabrizzio_Vilche"
annotations:
openshift.io/display-name: "wildlfy-thorntail-s2i-mvilche"
iconClass: "icon-wildfly"
description: >-
Compilador de imagenes para microservicios basados en java 11 y maven 3.6.0
Martin Fabrizzio Vilche.
https://github.com/mvilche.
objects:
- apiVersion: v1
data:
app.yaml: |-
swarm:
deployment:
example-jaas-basic.war:
web:
login-config:
auth-method: BASIC
security-domain: my-domain
security-constraints:
- url-pattern: /*
methods: [GET]
roles: [admin, user]
security:
security-domains:
my-domain:
classic-authentication:
login-modules:
Database:
code: Database
flag: required
module-options:
dsJndiName: java:jboss/datasources/MyDS
principalsQuery: SELECT password FROM REST_DB_ACCESS WHERE name=?
rolesQuery: SELECT role, 'Roles' FROM REST_DB_ACCESS WHERE name=?
datasources:
data-sources:
MyDS:
driver-name: h2
connection-url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
user-name: sa
password: sa
kind: ConfigMap
metadata:
name: ${APP_NAME}-project-defaults
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: "${APP_NAME}"
name: "${APP_NAME}"
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
app: wildfly-thorntail-s2i
deploymentconfig: ${APP_NAME}
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
labels:
app: wildfly-thorntail-s2i
deploymentconfig: ${APP_NAME}
spec:
containers:
- env:
- name: APP_OPTIONS
value: '-s /opt/config/app.yaml'
- name: JAVA_OPTS
value: ${JAVA_OPTS}
- name: TIMEZONE
value: America/Montevideo
image: "${APP_NAME}:latest"
imagePullPolicy: Always
name: ${APP_NAME}
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8778
protocolo: TCP
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- name: ${APP_NAME}-project-defaults
mountPath: /opt/config
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
terminationGracePeriodSeconds: 10
volumes:
- name: ${APP_NAME}-project-defaults
configMap:
name: ${APP_NAME}-project-defaults
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- ${APP_NAME}
from:
kind: ImageStreamTag
name: "${APP_NAME}:latest"
type: ImageChange
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: wildfly-thorntail-s2i
name: ${APP_NAME}-s2i
spec:
completionDeadlineSeconds: 1800
failedBuildsHistoryLimit: 5
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: ${APP_NAME}-s2i:latest
postCommit: {}
resources: {}
runPolicy: Serial
source:
git:
uri: ${REPO_GIT}
ref: ${BRANCH_GIT}
type: Git
sourceSecret:
name: ${SOURCE_SECRET}
strategy:
sourceStrategy:
incremental: true
forcePull: true
env:
- name: NEXUS_MIRROR_URL
value: ${NEXUS_MIRROR_URL}
- name: EXTRA_REPO
value: ${EXTRA_REPO}
- name: MVN_OPTS
value: ${MVN_OPTS}
- name: JAVA_OPTS
value: ${JAVA_OPTS}
from:
kind: ImageStreamTag
name: wildfly-thorntail-s2i:latest
type: Source
successfulBuildsHistoryLimit: 5
triggers:
- type: ConfigChange
- type: "imageChange"
imageChange:
from:
kind: "ImageStreamTag"
name: "wildfly-thorntail-s2i:latest"
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: wildfly-thorntail-s2i
name: ${APP_NAME}-runtime
spec:
completionDeadlineSeconds: 1800
output:
to:
kind: ImageStreamTag
name: ${APP_NAME}:latest
source:
type: Dockerfile
dockerfile: |-
FROM wildfly-thorntail-runtime:latest
USER root
COPY app.jar /opt/app-root/app.jar
RUN chown 1001:0 /opt/app-root/app.jar
USER 1001
images:
- from:
kind: ImageStreamTag
name: ${APP_NAME}-s2i:latest
paths:
- sourcePath: /opt/app-root/app.jar
destinationDir: "."
strategy:
dockerStrategy:
from:
kind: ImageStreamTag
name: wildfly-thorntail-runtime:latest
type: Docker
triggers:
- type: "imageChange"
imageChange:
from:
kind: "ImageStreamTag"
name: "${APP_NAME}-s2i:latest"
- apiVersion: v1
kind: Service
metadata:
labels:
app: wildfly-thorntail-s2i
name: ${APP_NAME}
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
- name: jolokia
port: 8778
protocol: TCP
targetPort: 8778
selector:
app: wildfly-thorntail-s2i
deploymentconfig: ${APP_NAME}
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: Route
metadata:
labels:
app: wildfly-thorntail-s2i
name: ${APP_NAME}
spec:
port:
targetPort: 8080-tcp
to:
kind: Service
name: ${APP_NAME}
weight: 100
wildcardPolicy: None
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: wildfly-thorntail-s2i
name: ${APP_NAME}
spec: {}
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: wildfly-thorntail-s2i
name: ${APP_NAME}-s2i
spec: {}
######
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: wildfly-thorntail-s2i
build: wildfly-thorntail-s2i
name: wildfly-thorntail-s2i
spec:
failedBuildsHistoryLimit: 5
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: 'wildfly-thorntail-s2i:latest'
postCommit: {}
resources: {}
runPolicy: Serial
source:
contextDir: openjdk${VERSION_JDK}
git:
ref: master
uri: 'https://github.com/mvilche/wildfly-thorntail.git'
type: Git
strategy:
dockerStrategy:
dockerfilePath: Dockerfile.jdk
type: Docker
successfulBuildsHistoryLimit: 5
triggers:
- type: ConfigChange
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: wildfly-thorntail-s2i
name: wildfly-thorntail-s2i
spec: {}
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: wildfly-thorntail-s2i
name: wildfly-thorntail-runtime
spec:
failedBuildsHistoryLimit: 5
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: 'wildfly-thorntail-runtime:latest'
postCommit: {}
resources: {}
runPolicy: Serial
source:
contextDir: openjdk${VERSION_JDK}
git:
ref: master
uri: 'https://github.com/mvilche/wildfly-thorntail.git'
type: Git
strategy:
dockerStrategy:
dockerfilePath: Dockerfile.jre
type: Docker
successfulBuildsHistoryLimit: 5
triggers:
- type: ConfigChange
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: wildfly-thorntail-s2i
name: wildfly-thorntail-runtime
spec: {}
######
parameters:
- name: APP_NAME
displayName: Nombre del microservicio
value: ''
required: true
- name: VERSION_JDK
displayName: Versión de OPENJDK
value: '11'
required: true
- name: REPO_GIT
displayName: Repositorio git donde se encuentra la aplicacion
value: ""
required: true
- name: BRANCH_GIT
displayName: Nombre del branch del repositorio
value: ""
required: true
- name: SOURCE_SECRET
displayName: Nombre del secret para autenticacion con el git
value: ""
required: true
- name: MVN_OPTS
displayName: Argumentos adicionales maven. Valores por defecto (clean package -Dfile.encoding=UTF-8 -DskipTests=true)
value: ""
- name: NEXUS_MIRROR_URL
displayName: Especifique repositorio nexus para la descarga de las dependencias. Recomendado
value: ""
- name: EXTRA_REPO
displayName: Repositorio git adicional para compilar previo al microservicio. Ej shared
value: ""
- name: JAVA_OPTS
displayName: Parametros jvm para el inicio del microservicio
value: ""