-
Notifications
You must be signed in to change notification settings - Fork 14
/
deployment.yaml
278 lines (278 loc) · 7.48 KB
/
deployment.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
apiVersion: v1
kind: Template
metadata:
name: "peopleapi-template"
annotations:
description: "Demo People API"
iconClass: "icon-dotnet"
tags: "dotnet,core"
labels:
application: "peopleapi"
createdBy: "peopleapi-template"
objects:
- apiVersion: v1
kind: "ImageStream"
metadata:
name: "peopleapi"
- apiVersion: v1
kind: "ImageStream"
metadata:
name: "peopleapidb"
- apiVersion: v1
kind: "BuildConfig"
metadata:
name: "peopleapi-bc"
annotations:
description: "Defines how to build the People API webapi app."
labels:
app: peopleapi
namespace: peopleapi
spec:
env:
- name: "GIT_SSL_NO_VERIFY"
value: "true"
source:
type: "Git"
git:
ref: ${CONSUMER_GIT_BRANCH}
uri: ${CONSUMER_GIT_URL}
contextDir: "/"
strategy:
dockerStrategy:
dockerfilePath: Dockerfile
output:
to:
kind: "ImageStreamTag"
name: "peopleapi:latest"
- apiVersion: v1
kind: "BuildConfig"
metadata:
name: "peopleapidb-bc"
annotations:
description: "Defines how to build the People API database."
labels:
app: peopleapidb
namespace: peopleapi
spec:
env:
- name: "GIT_SSL_NO_VERIFY"
value: "true"
source:
type: "Git"
git:
ref: ${CONSUMER_GIT_BRANCH}
uri: ${CONSUMER_GIT_URL}
contextDir: "database"
strategy:
dockerStrategy:
dockerfilePath: Dockerfile
output:
to:
kind: "ImageStreamTag"
name: "peopleapidb:latest"
- apiVersion: v1
kind: "BuildConfig"
metadata:
name: "peopleapi-bc-pipeline"
spec:
source:
git:
ref: ${CONSUMER_GIT_BRANCH}
uri: ${CONSUMER_GIT_URL}
sourceSecret:
name: "peopleapi-source-control"
strategy:
jenkinsPipelineStrategy:
jenkinsfilePath: Jenkinsfile
- apiVersion: v1
kind: "Service"
metadata:
name: "peopleapi-svc"
annotations:
description: "Exposes and load balances the application pods"
spec:
ports:
- name: "peopleapi"
port: 8080
targetPort: 8080
selector:
name: "peopleapi"
- apiVersion: v1
kind: "Service"
metadata:
name: "peopleapidb-svc"
annotations:
description: "Exposes the application database"
spec:
ports:
- name: "peopleapidb"
port: 1433
targetPort: 1433
selector:
name: "peopleapidb"
- apiVersion: v1
kind: Route
metadata:
annotations:
openshift.io/host.generated: 'true'
labels:
app: peopleapi
name: peopleapi
namespace: peopleapi
spec:
to:
kind: Service
name: peopleapi-svc
weight: 100
wildcardPolicy: None
- apiVersion: v1
kind: "DeploymentConfig"
metadata:
name: "peopleapi-dc"
annotations:
description: "Handles deployment of the demo People API application"
generation: 2
labels:
app: peopleapi-template
application: peopleapi
createdBy: peopleapi-template
namespace: peopleapi
spec:
replicas: 1
selector:
name: peopleapi
strategy:
activeDeadlineSeconds: 21600
recreateParams:
timeoutSeconds: 600
resources: {}
type: Recreate
template:
metadata:
labels:
name: "peopleapi"
spec:
containers:
- name: peopleapi
env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: 'http://*:8080'
- name: peopleapicontext
value: ${PEOPLEAPI_CONN_STRING}
image: 'peopleapi/peopleapi:latest'
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
test: false
triggers:
- type: "ConfigChange"
- type: "ImageChange"
imageChangeParams:
automatic: true
containerNames:
- "peopleapi"
from:
kind: "ImageStreamTag"
name: "peopleapi:latest"
- apiVersion: v1
kind: "DeploymentConfig"
metadata:
name: "peopleapidb-dc"
annotations:
description: "Handles deployment of the demo People API MSSQL Express Linux database"
generation: 2
labels:
app: peopleapi-template
application: peopleapi
createdBy: peopleapi-template
namespace: peopleapi
spec:
replicas: 1
selector:
name: peopleapidb
strategy:
activeDeadlineSeconds: 21600
recreateParams:
timeoutSeconds: 600
resources: {}
type: Recreate
template:
metadata:
labels:
name: "peopleapidb"
spec:
containers:
- name: peopleapidb
image: 'peopleapi/peopleapidb:latest'
imagePullPolicy: IfNotPresent
ports:
- containerPort: 1433
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/opt/mssql
name: mssql-data
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: mssql-data
persistentVolumeClaim:
claimName: mssql-peopleapidb-data
test: false
triggers:
- type: "ConfigChange"
- type: "ImageChange"
imageChangeParams:
automatic: true
containerNames:
- "peopleapidb"
from:
kind: "ImageStreamTag"
name: "peopleapidb:latest"
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mssql-peopleapidb-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: ${MSSQL_VOLUME_CAPACITY}
parameters:
- name: "CONSUMER_GIT_URL"
displayName: "Source Repository URL"
description: "The URL of the repository with your application source code"
value: "https://github.com/Cingulara/peopleapi-jenkins-auto-deploy.git"
required: true
- name: "CONSUMER_GIT_BRANCH"
displayName: "Source Repository Branch"
description: "The branch within the git repository with your application source code"
value: "develop"
required: true
- name: "PEOPLEAPI_CONN_STRING"
displayName: "Connection String for PeopleAPI"
description: "The database connection string for the peopleapidb database for this API"
value: "server=peopleapidb; user id=peopleAPI; password=myP@ssw0rd; initial catalog=peopleAPI;"
required: true
- name: MSSQL_VOLUME_CAPACITY
description: Volume space available for MSSQL
displayName: MSSQL Volume Capacity
required: true
value: 1Gi