-
Notifications
You must be signed in to change notification settings - Fork 0
/
openshift-template.yml
271 lines (244 loc) · 6.55 KB
/
openshift-template.yml
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
apiVersion: v1
kind: Template
labels:
template: s2i-isds-gmail-example-spring-boot
metadata:
annotations:
description: Spring-Boot and Camel QuickStart. This example demonstrates how you
can use Apache Camel with Spring Boot on Openshift. The quickstart uses Spring
Boot to configure a little application that includes a Camel route that triggeres
a message every 5th second, and routes the message to a log.
iconClass: icon-jboss
tags: isds
version: "2.0"
name: isds-gmail-example-spring-boot
parameters:
- description: The name assigned to the application.
displayName: Application Name
name: APP_NAME
required: true
value: isds-gmail-example-spring-boot
- description: The URL of the repository with your application source code.
displayName: Git Repository URL
name: GIT_REPO
required: true
value: https://github.com/czgov/isds-gmail-example-spring-boot.git
- description: Set this to a branch name, tag or other ref of your repository if you
are not using the default branch.
displayName: Git Reference
name: GIT_REF
value: master
- description: The version of the FIS S2I builder image to use.
displayName: Builder version
name: BUILDER_VERSION
value: "2.0"
- description: The application version.
displayName: Application Version
name: APP_VERSION
value: 2.2.64-SNAPSHOT
- description: Arguments passed to mvn in the build.
displayName: Maven Arguments
name: MAVEN_ARGS
value: package -DskipTests -Dfabric8.skip -e -B
- description: Extra arguments passed to mvn, e.g. for multi-module builds.
displayName: Extra Maven Arguments
name: MAVEN_ARGS_APPEND
- description: Directory of the artifact to be built, e.g. for multi-module builds.
displayName: Maven build directory
name: ARTIFACT_DIR
- description: The secret needed to trigger a build.
displayName: Git Build Secret
from: '[a-zA-Z0-9]{40}'
generate: expression
name: BUILD_SECRET
- description: The amount of CPU to requests.
displayName: CPU request
name: CPU_REQUEST
required: true
value: "0.2"
- description: The amount of CPU the container is limited to use.
displayName: CPU limit
name: CPU_LIMIT
required: true
value: "1.0"
- description: whether to connect to TEST or PRODUCTION instance of isds
displayName: ISDS Environment
name: ISDS_ENV
required: true
value: "PRODUCTION"
- description: user login for isds
displayName: login
name: ISDS_LOGIN
required: true
- description: user password for isds
displayName: password
name: ISDS_PASSWORD
required: true
- description: how often should it check for new messages
displayName: delay
name: ISDS_DELAY
required: true
value: "10s"
- description: forward isds messages to this e-mail address
displayName: recipient
name: GMAIL_RECIPIENT
required: true
- description: user e-mail to use as login
displayName: gmail login
name: GMAIL_LOGIN
required: true
value: "...@gmail.com"
- description: user password
displayName: password
name: GMAIL_PASSWORD
required: true
objects:
- apiVersion: v1
kind: ImageStream
metadata:
creationTimestamp: null
labels:
component: ${APP_NAME}
group: quickstarts
project: ${APP_NAME}
provider: s2i
version: ${APP_VERSION}
name: ${APP_NAME}
spec: {}
status:
dockerImageRepository: ""
- apiVersion: v1
kind: BuildConfig
metadata:
creationTimestamp: null
labels:
component: ${APP_NAME}
group: quickstarts
project: ${APP_NAME}
provider: s2i
version: ${APP_VERSION}
name: ${APP_NAME}
spec:
output:
to:
kind: ImageStreamTag
name: ${APP_NAME}:latest
resources: {}
source:
git:
ref: ${GIT_REF}
uri: ${GIT_REPO}
type: Git
strategy:
type: Source
sourceStrategy:
env:
- name: BUILD_LOGLEVEL
value: "5"
- name: ARTIFACT_DIR
value: ${ARTIFACT_DIR}
- name: MAVEN_ARGS
value: ${MAVEN_ARGS}
- name: MAVEN_ARGS_APPEND
value: ${MAVEN_ARGS_APPEND}
forcePull: true
from:
kind: DockerImage
name: fabric8/s2i-java:${BUILDER_VERSION}
incremental: true
triggers:
- github:
secret: ${BUILD_SECRET}
type: GitHub
- generic:
secret: ${BUILD_SECRET}
type: Generic
- type: ConfigChange
- imageChange: {}
type: ImageChange
status:
lastVersion: 0
- apiVersion: v1
kind: DeploymentConfig
metadata:
creationTimestamp: null
labels:
component: ${APP_NAME}
group: quickstarts
project: ${APP_NAME}
provider: s2i
version: ${APP_VERSION}
name: ${APP_NAME}
spec:
replicas: 1
selector:
component: ${APP_NAME}
deploymentconfig: ${APP_NAME}
group: quickstarts
project: ${APP_NAME}
provider: s2i
version: ${APP_VERSION}
strategy:
resources: {}
template:
metadata:
creationTimestamp: null
labels:
component: ${APP_NAME}
deploymentconfig: ${APP_NAME}
group: quickstarts
project: ${APP_NAME}
provider: s2i
version: ${APP_VERSION}
spec:
containers:
- env:
- name: ISDS_ENV
value: ${ISDS_ENV}
- name: ISDS_LOGIN
value: ${ISDS_LOGIN}
- name: ISDS_PASSWORD
value: ${ISDS_PASSWORD}
- name: GMAIL_LOGIN
value: ${GMAIL_LOGIN}
- name: GMAIL_RECIPIENT
value: ${GMAIL_RECIPIENT}
- name: GMAIL_PASSWORD
value: ${GMAIL_PASSWORD}
- name: ISDS_DELAY
value: ${ISDS_DELAY}
- name: KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: library/${APP_NAME}:latest
livenessProbe:
httpGet:
path: /health
port: 8081
initialDelaySeconds: 180
name: ${APP_NAME}
ports:
- containerPort: 8778
name: jolokia
readinessProbe:
httpGet:
path: /health
port: 8081
initialDelaySeconds: 10
resources:
limits:
cpu: ${CPU_LIMIT}
requests:
cpu: ${CPU_REQUEST}
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- ${APP_NAME}
from:
kind: ImageStreamTag
name: ${APP_NAME}:latest
type: ImageChange
status: {}