-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathworkflow-openshift-4-demo.yaml
315 lines (300 loc) · 10.2 KB
/
workflow-openshift-4-demo.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
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: openshift-4-demo-
spec:
entrypoint: start
onExit: destroy
arguments:
parameters:
- name: name
- name: openshift-version
value: ""
- name: image-registry
- name: main-image-tag
- name: scanner-image-tag
- name: scanner-db-image-tag
- name: collector-slim-image-tag
- name: central-db-image-tag
- name: central-services-helm-chart-version
- name: secured-cluster-services-helm-chart-version
- name: trusted-certs-enabled
- name: credentials-mode
- name: region
- name: ssd-storage-class
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Mi
volumes:
- name: credentials
secret:
secretName: openshift-4-gcp-service-account
- name: demo-secrets
secret:
secretName: demo-secrets
templates:
- name: start
steps:
- - name: create
template: create
- - name: pre-install
template: pre-install
- - name: roxctl-central
template: roxctl-central
- - name: roxctl-secured-cluster-services
template: roxctl-secured-cluster-services
- - name: run-ansible-demo
template: run-ansible-demo
continueOn:
failed: true
arguments:
parameters:
- name: admin-password
value: '{{ "{{" }}steps.pre-install.outputs.parameters.admin-password{{ "}}" }}'
- name: kubeconfig-base64
value: '{{ "{{" }}steps.pre-install.outputs.parameters.kubeconfig-base64{{ "}}" }}'
artifacts:
- name: roxctl-central
from: '{{ "{{" }}steps.roxctl-central.outputs.artifacts.roxctl-central{{ "}}" }}'
- name: roxctl-secured-cluster-services
from: '{{ "{{" }}steps.roxctl-secured-cluster-services.outputs.artifacts.roxctl-secured-cluster-services{{ "}}" }}'
- - name: gather
template: gather
- - name: wait
template: wait
- name: create
container:
image: quay.io/stackrox-io/ci:automation-flavors-openshift-4-{{ .Chart.Annotations.automationFlavorsVersion }}
imagePullPolicy: Always
volumeMounts:
- name: data
mountPath: /data
command:
- entrypoint.sh
args:
- create
- '{{ "{{" }}workflow.parameters.name{{ "}}" }}'
- ocp.infra.rox.systems
env:
- name: GOOGLE_CREDENTIALS
valueFrom:
secretKeyRef:
name: openshift-4-gcp-service-account
key: google-credentials.json
- name: GCP_PROJECT
value : "acs-team-temp-dev"
- name: PULL_SECRET
valueFrom:
secretKeyRef:
name: redhat-pull-secret
key: REDHAT_PULL_SECRET
- name: OPENSHIFT_VERSION
value: '{{ "{{" }}workflow.parameters.openshift-version{{ "}}" }}'
- name: MASTER_NODE_COUNT
value: "3"
- name: WORKER_NODE_COUNT
value: "3"
- name: MASTER_NODE_TYPE
value: "n1-standard-4"
- name: WORKER_NODE_TYPE
value: "e2-standard-16"
- name: REGION
value: '{{ "{{" }}workflow.parameters.region{{ "}}" }}'
- name: TRUSTED_CERTS_ENABLED
value: '{{ "{{" }}workflow.parameters.trusted-certs-enabled{{ "}}" }}'
- name: CREDENTIALS_MODE
value: '{{ "{{" }}workflow.parameters.credentials-mode{{ "}}" }}'
- name: SSD_STORAGE_CLASS
value: '{{ "{{" }}workflow.parameters.ssd-storage-class{{ "}}" }}'
- name: pre-install
script:
image: rnix/openssl-gost
volumeMounts:
- name: data
mountPath: /data
command: [sh]
source: |
openssl rand -base64 32 | tr "+/" "_#" | cut -c 1-20 > /data/admin_password
base64 /data/auth/kubeconfig | tr -d "\n" > /data/auth/kubeconfig_base64
subdomain=apps.{{ "{{" }}workflow.parameters.name{{ "}}" }}.ocp.infra.rox.systems
echo "https://console-openshift-console.${subdomain}" > /data/url-openshift
echo "https://central-stackrox.${subdomain}" > /data/url-stackrox
outputs:
parameters:
- name: admin-password
valueFrom:
path: /data/admin_password
- name: kubeconfig-base64
valueFrom:
path: /data/auth/kubeconfig_base64
- name: run-ansible-demo
inputs:
parameters:
- name: admin-password
- name: kubeconfig-base64
artifacts:
- name: roxctl-central
path: /usr/bin/roxctl-central
- name: roxctl-secured-cluster-services
path: /usr/bin/roxctl-secured-cluster-services
container:
image: quay.io/stackrox-io/ci:automation-flavors-openshift-4-demo-{{ .Chart.Annotations.automationFlavorsVersion }}
imagePullPolicy: Always
command:
- ansible-playbook
args: ["-i", "inventory.yml", "main.yml"]
env:
- name: IMAGE_PULL_USER
valueFrom:
secretKeyRef:
name: demo-secrets
key: QUAY_RHACS_ENG_RO_USERNAME
- name: IMAGE_PULL_PASSWORD
valueFrom:
secretKeyRef:
name: demo-secrets
key: QUAY_RHACS_ENG_RO_PASSWORD
- name: GOOGLE_CREDENTIALS
valueFrom:
secretKeyRef:
name: openshift-4-gcp-service-account
key: google-credentials.json
- name: CENTRAL_PORT
value: "443"
- name: ORCHESTRATOR
value: openshift
- name: ADMIN_PASSWORD
value: '{{ "{{" }}inputs.parameters.admin-password{{ "}}" }}'
- name: KUBECONFIG_BASE64
value: '{{ "{{" }}inputs.parameters.kubeconfig-base64{{ "}}" }}'
- name: IMAGE_REGISTRY
value: '{{ "{{" }}workflow.parameters.image-registry{{ "}}" }}'
- name: MAIN_IMAGE_TAG
value: '{{ "{{" }}workflow.parameters.main-image-tag{{ "}}" }}'
- name: SCANNER_IMAGE_TAG
value: '{{ "{{" }}workflow.parameters.scanner-image-tag{{ "}}" }}'
- name: SCANNER_DB_IMAGE_TAG
value: '{{ "{{" }}workflow.parameters.scanner-db-image-tag{{ "}}" }}'
- name: COLLECTOR_SLIM_IMAGE_TAG
value: '{{ "{{" }}workflow.parameters.collector-slim-image-tag{{ "}}" }}'
- name: CENTRAL_DB_IMAGE_TAG
value: '{{ "{{" }}workflow.parameters.central-db-image-tag{{ "}}" }}'
- name: ANSIBLE_STDOUT_CALLBACK
value: debug
volumeMounts:
- name: data
mountPath: /data
- name: gather
script:
image: busybox
command: [sh]
source: |
cd /data
. ./dotenv
echo "${OPENSHIFT_CONSOLE_URL}" > cluster-console-url
echo "${OPENSHIFT_CONSOLE_USERNAME}" > cluster-console-username
echo "${OPENSHIFT_CONSOLE_PASSWORD}" > cluster-console-password
volumeMounts:
- name: data
mountPath: /data
outputs:
artifacts:
- name: admin-password
path: /data/admin_password
archive:
none: {}
- name: kubeconfig
path: /data/auth/kubeconfig
archive:
none: {}
- name: SSH_ACCESS
path: /data/ssh/SSH_ACCESS.md
archive:
none: {}
- name: url-openshift
path: /data/url-openshift
archive:
none: {}
- name: url-stackrox
path: /data/url-stackrox
archive:
none: {}
- name: dotenv
path: /data/dotenv
archive:
none: {}
- name: data
path: /data
archive:
tar: {}
- name: cluster-console-url
path: /data/cluster-console-url
archive:
none: {}
- name: cluster-console-username
path: /data/cluster-console-username
archive:
none: {}
- name: cluster-console-password
path: /data/cluster-console-password
archive:
none: {}
- name: wait
suspend: {}
- name: destroy
container:
image: quay.io/stackrox-io/ci:automation-flavors-openshift-4-{{ .Chart.Annotations.automationFlavorsVersion }}
imagePullPolicy: Always
command:
- entrypoint.sh
args:
- destroy
- '{{ "{{" }}workflow.parameters.name{{ "}}" }}'
env:
- name: GOOGLE_CREDENTIALS
valueFrom:
secretKeyRef:
name: openshift-4-gcp-service-account
key: google-credentials.json
- name: GCP_PROJECT
value : "acs-team-temp-dev"
volumeMounts:
- name: data
mountPath: /data
- name: roxctl-central
activeDeadlineSeconds: 600
outputs:
artifacts:
- name: roxctl-central
path: /tmp/roxctl-central
container:
image: 'quay.io/stackrox-io/main:{{ "{{" }}workflow.parameters.central-services-helm-chart-version{{ "}}" }}'
imagePullPolicy: Always
command:
- cp
args:
- --dereference
- -v
- /stackrox/roxctl
- /tmp/roxctl-central
- name: roxctl-secured-cluster-services
activeDeadlineSeconds: 600
outputs:
artifacts:
- name: roxctl-secured-cluster-services
path: /tmp/roxctl-secured-cluster-services
container:
image: 'quay.io/stackrox-io/main:{{ "{{" }}workflow.parameters.secured-cluster-services-helm-chart-version{{ "}}" }}'
imagePullPolicy: Always
command:
- cp
args:
- --dereference
- -v
- /stackrox/roxctl
- /tmp/roxctl-secured-cluster-services