-
Notifications
You must be signed in to change notification settings - Fork 40
/
deployment.yaml.tmpl
315 lines (315 loc) · 12.2 KB
/
deployment.yaml.tmpl
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{.APIServerDefaultResourceName}}
namespace: {{.Namespace}}
labels:
app: {{.APIServerDefaultResourceName}}
component: data-science-pipelines
dspa: {{.Name}}
spec:
selector:
matchLabels:
app: {{.APIServerDefaultResourceName}}
component: data-science-pipelines
dspa: {{.Name}}
template:
metadata:
labels:
app: {{.APIServerDefaultResourceName}}
component: data-science-pipelines
dspa: {{.Name}}
spec:
containers:
- env:
{{ if .IncludeOwnerReference }}
- name: OWNER_UID
value: "{{.UID}}"
- name: OWNER_NAME
value: "{{.Name}}"
- name: OWNER_API_VERSION
value: "{{.APIVersion}}"
- name: OWNER_KIND
value: "{{.Kind}}"
{{ end }}
- name: POD_NAMESPACE
value: "{{.Namespace}}"
- name: DBCONFIG_USER
value: "{{.DBConnection.Username}}"
- name: DBCONFIG_PASSWORD
valueFrom:
secretKeyRef:
key: "{{.DBConnection.CredentialsSecret.Key}}"
name: "{{.DBConnection.CredentialsSecret.Name}}"
- name: DBCONFIG_DBNAME
value: "{{.DBConnection.DBName}}"
- name: DBCONFIG_HOST
value: "{{.DBConnection.Host}}"
- name: DBCONFIG_PORT
value: "{{.DBConnection.Port}}"
{{ if .CustomCABundle }}
- name: ARTIFACT_COPY_STEP_CABUNDLE_CONFIGMAP_NAME
value: "{{.CustomCABundle.ConfigMapName}}"
- name: ARTIFACT_COPY_STEP_CABUNDLE_CONFIGMAP_KEY
value: "{{.CustomCABundle.ConfigMapKey}}"
- name: ARTIFACT_COPY_STEP_CABUNDLE_MOUNTPATH
value: {{ .CustomCABundleRootMountPath }}
{{ end }}
{{ if .CustomSSLCertDir }}
- name: SSL_CERT_DIR
value: {{.CustomSSLCertDir}}
{{ end }}
- name: AUTO_UPDATE_PIPELINE_DEFAULT_VERSION
value: "{{.APIServer.AutoUpdatePipelineDefaultVersion}}"
- name: DBCONFIG_CONMAXLIFETIMESEC
value: "{{.APIServer.DBConfigConMaxLifetimeSec}}"
- name: ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_HOST
value: "ds-pipeline-visualizationserver"
- name: ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_PORT
value: "8888"
- name: OBJECTSTORECONFIG_CREDENTIALSSECRET
value: "{{.ObjectStorageConnection.CredentialsSecret.SecretName}}"
- name: OBJECTSTORECONFIG_CREDENTIALSACCESSKEYKEY
value: "{{.ObjectStorageConnection.CredentialsSecret.AccessKey}}"
- name: OBJECTSTORECONFIG_CREDENTIALSSECRETKEYKEY
value: "{{.ObjectStorageConnection.CredentialsSecret.SecretKey}}"
- name: DEFAULTPIPELINERUNNERSERVICEACCOUNT
value: "pipeline-runner-{{.Name}}"
- name: OBJECTSTORECONFIG_BUCKETNAME
value: "{{.ObjectStorageConnection.Bucket}}"
- name: OBJECTSTORECONFIG_ACCESSKEY
valueFrom:
secretKeyRef:
key: "{{.ObjectStorageConnection.CredentialsSecret.AccessKey}}"
name: "{{.ObjectStorageConnection.CredentialsSecret.SecretName}}"
- name: OBJECTSTORECONFIG_SECRETACCESSKEY
valueFrom:
secretKeyRef:
key: "{{.ObjectStorageConnection.CredentialsSecret.SecretKey}}"
name: "{{.ObjectStorageConnection.CredentialsSecret.SecretName}}"
- name: OBJECTSTORECONFIG_SECURE
value: "{{.ObjectStorageConnection.Secure}}"
{{ if .ObjectStorageConnection.BasePath }}
- name: OBJECTSTORECONFIG_PIPELINEPATH
value: "{{.ObjectStorageConnection.BasePath}}"
{{ end }}
- name: MINIO_SERVICE_SERVICE_HOST
value: "{{.ObjectStorageConnection.Host}}"
- name: MINIO_SERVICE_SERVICE_PORT
value: "{{.ObjectStorageConnection.Port}}"
- name: V2_LAUNCHER_IMAGE
value: "{{.APIServer.ArgoLauncherImage}}"
- name: V2_DRIVER_IMAGE
value: "{{.APIServer.ArgoDriverImage}}"
## Env Vars to only include if MLMD Deployed ##
{{ if .MLMD }}
{{ if .MLMD.Deploy }}
- name: METADATA_GRPC_SERVICE_SERVICE_HOST
value: "ds-pipeline-metadata-grpc-{{.Name}}.{{.Namespace}}.svc.cluster.local"
{{ if .MLMD.GRPC.Port }}
- name: METADATA_GRPC_SERVICE_SERVICE_PORT
value: "{{.MLMD.GRPC.Port}}"
{{ end }}
{{ end }}
{{ end }}
- name: ML_PIPELINE_SERVICE_HOST
value: "ds-pipeline-{{.Name}}.{{.Namespace}}.svc.cluster.local"
- name: ML_PIPELINE_SERVICE_PORT_GRPC
value: "8887"
{{ if (eq .DSPVersion "v2") }}
## Argo-Specific Env Vars ##
- name: EXECUTIONTYPE
value: Workflow
- name: DB_DRIVER_NAME
value: mysql
- name: DBCONFIG_MYSQLCONFIG_USER
value: "{{.DBConnection.Username}}"
- name: DBCONFIG_MYSQLCONFIG_PASSWORD
valueFrom:
secretKeyRef:
key: "{{.DBConnection.CredentialsSecret.Key}}"
name: "{{.DBConnection.CredentialsSecret.Name}}"
- name: DBCONFIG_MYSQLCONFIG_DBNAME
value: "{{.DBConnection.DBName}}"
- name: DBCONFIG_MYSQLCONFIG_HOST
value: "{{.DBConnection.Host}}"
- name: DBCONFIG_MYSQLCONFIG_PORT
value: "{{.DBConnection.Port}}"
{{ else }}
## Tekton-Specific Env Vars ##
- name: EXECUTIONTYPE
value: PipelineRun
- name: CACHE_IMAGE
value: "{{.APIServer.CacheImage}}"
- name: MOVERESULTS_IMAGE
value: "{{.APIServer.MoveResultsImage}}"
- name: ARTIFACT_IMAGE
value: "{{.APIServer.ArtifactImage}}"
- name: ARTIFACT_BUCKET
value: "{{.ObjectStorageConnection.Bucket}}"
- name: ARTIFACT_ENDPOINT
value: "{{.ObjectStorageConnection.Endpoint}}"
- name: ARTIFACT_SCRIPT
valueFrom:
configMapKeyRef:
key: "{{ .APIServer.ArtifactScriptConfigMap.Key }}"
name: "{{ .APIServer.ArtifactScriptConfigMap.Name }}"
- name: ARCHIVE_LOGS
value: "{{.APIServer.ArchiveLogs}}"
- name: TRACK_ARTIFACTS
value: "{{.APIServer.TrackArtifacts}}"
- name: STRIP_EOF
value: "{{.APIServer.StripEOF}}"
- name: PIPELINE_RUNTIME
value: "tekton"
- name: INJECT_DEFAULT_SCRIPT
value: "{{.APIServer.InjectDefaultScript}}"
- name: APPLY_TEKTON_CUSTOM_RESOURCE
value: "{{.APIServer.ApplyTektonCustomResource}}"
- name: TERMINATE_STATUS
value: "{{.APIServer.TerminateStatus}}"
{{ end }}
image: {{.APIServer.Image}}
imagePullPolicy: Always
name: ds-pipeline-api-server
command: ['/bin/apiserver']
args:
- --config=/config
- -logtostderr=true
{{ if .APIServer.EnableSamplePipeline }}
- --sampleconfig=/config/sample_config.json
{{ end }}
ports:
- containerPort: 8888
name: http
- containerPort: 8887
name: grpc
livenessProbe:
exec:
command:
- wget
- -q
- -S
- -O
- '-'
- http://localhost:8888/apis/v1beta1/healthz
initialDelaySeconds: 3
periodSeconds: 5
timeoutSeconds: 2
readinessProbe:
exec:
command:
- wget
- -q
- -S
- -O
- '-'
- http://localhost:8888/apis/v1beta1/healthz
initialDelaySeconds: 3
periodSeconds: 5
timeoutSeconds: 2
resources:
{{ if .APIServer.Resources.Requests }}
requests:
{{ if .APIServer.Resources.Requests.CPU }}
cpu: {{.APIServer.Resources.Requests.CPU}}
{{ end }}
{{ if .APIServer.Resources.Requests.Memory }}
memory: {{.APIServer.Resources.Requests.Memory}}
{{ end }}
{{ end }}
{{ if .APIServer.Resources.Limits }}
limits:
{{ if .APIServer.Resources.Limits.CPU }}
cpu: {{.APIServer.Resources.Limits.CPU}}
{{ end }}
{{ if .APIServer.Resources.Limits.Memory }}
memory: {{.APIServer.Resources.Limits.Memory}}
{{ end }}
{{ end }}
volumeMounts:
- name: server-config
mountPath: /config/config.json
subPath: {{ .APIServer.CustomServerConfig.Key }}
{{ if or .APIServer.EnableSamplePipeline .CustomCABundle }}
{{ if .APIServer.EnableSamplePipeline }}
- name: sample-config
mountPath: /config/sample_config.json
subPath: sample_config.json
- name: sample-pipeline
mountPath: /samples/
{{ end }}
{{ if .CustomCABundle }}
- mountPath: {{ .CustomCABundleRootMountPath }}
name: ca-bundle
{{ end }}
{{ end }}
{{ if .APIServer.EnableRoute }}
- name: oauth-proxy
args:
- --https-address=:8443
- --provider=openshift
- --openshift-service-account={{.APIServerDefaultResourceName}}
- --upstream=http://localhost:8888
- --tls-cert=/etc/tls/private/tls.crt
- --tls-key=/etc/tls/private/tls.key
- --cookie-secret=SECRET
- '--openshift-delegate-urls={"/": {"group":"route.openshift.io","resource":"routes","verb":"get","name":"{{.APIServerDefaultResourceName}}","namespace":"{{.Namespace}}"}}'
- '--openshift-sar={"namespace":"{{.Namespace}}","resource":"routes","resourceName":"{{.APIServerDefaultResourceName}}","verb":"get","resourceAPIGroup":"route.openshift.io"}'
- --skip-auth-regex='(^/metrics|^/apis/v1beta1/healthz)'
image: {{.OAuthProxy}}
ports:
- containerPort: 8443
name: oauth
livenessProbe:
httpGet:
path: /oauth/healthz
port: oauth
scheme: HTTPS
initialDelaySeconds: 30
timeoutSeconds: 1
periodSeconds: 5
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: /oauth/healthz
port: oauth
scheme: HTTPS
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 5
successThreshold: 1
failureThreshold: 3
resources:
limits:
cpu: 100m
memory: 256Mi
requests:
cpu: 100m
memory: 256Mi
volumeMounts:
- mountPath: /etc/tls/private
name: proxy-tls
{{ end }}
serviceAccountName: {{.APIServerDefaultResourceName}}
volumes:
- name: proxy-tls
secret:
secretName: ds-pipelines-proxy-tls-{{.Name}}
- name: server-config
configMap:
name: {{ .APIServer.CustomServerConfig.Name }}
{{ if .CustomCABundle }}
- name: ca-bundle
configMap:
name: {{ .CustomCABundle.ConfigMapName }}
{{ end }}
{{ if .APIServer.EnableSamplePipeline }}
- name: sample-config
configMap:
name: sample-config-{{.Name}}
- name: sample-pipeline
configMap:
name: sample-pipeline-{{.Name}}
{{ end }}