forked from openshift/release
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
366 lines (302 loc) · 17.5 KB
/
Makefile
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
.PHONY: check check-core dry-core-admin core-admin dry-core core
check: check-core
@echo "Service config check: PASS"
check-core:
core-services/_hack/validate-core-services.sh core-services
@echo "Core service config check: PASS"
# applyconfig is https://github.com/openshift/ci-tools/tree/master/cmd/applyconfig
dry-core-admin:
applyconfig --config-dir core-services --level=admin
core-admin:
applyconfig --config-dir core-services --level=admin --confirm=true
dry-core:
applyconfig --config-dir core-services
core:
applyconfig --config-dir core-services --confirm=true
# these are useful for devs
jobs:
docker pull registry.svc.ci.openshift.org/ci/ci-operator-prowgen:latest
docker run -it -v "${CURDIR}/ci-operator:/ci-operator" registry.svc.ci.openshift.org/ci/ci-operator-prowgen:latest --from-dir /ci-operator/config --to-dir /ci-operator/jobs
# LEGACY TARGETS
# You should not need to add new targets here.
export RELEASE_URL=https://github.com/openshift/release.git
export RELEASE_REF=master
export SKIP_PERMISSIONS_JOB=0
apply:
oc apply -f $(WHAT)
.PHONY: apply
applyTemplate:
oc process -f $(WHAT) | oc apply -f -
.PHONY: applyTemplate
postsubmit-update: prow-services origin-release libpod prow-monitoring build-dashboards-validation-image cincinnati prow-release-controller-definitions
.PHONY: postsubmit-update
all: roles prow projects
.PHONY: all
cluster-roles:
$(MAKE) apply WHAT=cluster/ci/config/roles.yaml
.PHONY: cluster-roles
roles: cluster-operator-roles cluster-roles
.PHONY: roles
prow: prow-ci-ns prow-ci-stg-ns prow-openshift-ns
.PHONY: prow
prow-ci-ns: ci-ns prow-crd prow-config prow-rbac prow-services prow-jobs prow-scaling prow-secrets
.PHONY: prow-ci-ns
prow-ci-stg-ns: ci-stg-ns prow-cluster-jobs
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/ci-operator/stage.yaml
.PHONY: prow-ci-stg-ns
prow-openshift-ns: openshift-ns
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/config_updater_rbac.yaml
.PHONY: prow-openshift-ns
ci-ns:
oc project ci
.PHONY: ci-ns
ci-stg-ns:
oc project ci-stg
.PHONY: ci-stg-ns
openshift-ns:
oc project openshift
.PHONY: openshift-ns
prow-crd:
$(MAKE) apply WHAT=cluster/ci/config/prow/prow_crd.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/prowjob_access.yaml
.PHONY: prow-crd
prow-scaling:
oc apply -n kube-system -f cluster/ci/config/cluster-autoscaler.yaml
.PHONY: prow-scaling
prow-config:
oc create cm config --from-file=config.yaml=cluster/ci/config/prow/config.yaml
oc create cm plugins --from-file=plugins.yaml=cluster/ci/config/prow/plugins.yaml
.PHONY: prow-config
prow-config-update:
oc create cm labels --from-file=cluster/ci/config/prow/labels.yaml -o yaml --dry-run | oc replace -f -
oc create cm config --from-file=config.yaml=cluster/ci/config/prow/config.yaml -o yaml --dry-run | oc replace -f -
oc create cm plugins --from-file=plugins.yaml=cluster/ci/config/prow/plugins.yaml -o yaml --dry-run | oc replace -f -
.PHONY: prow-config-update
prow-secrets:
ci-operator/populate-secrets-from-bitwarden.sh
oc create configmap secret-mirroring --from-file=cluster/ci/config/secret-mirroring/mapping.yaml -o yaml --dry-run | oc apply -f -
.PHONY: prow-secrets
prow-rbac:
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/artifact-uploader_rbac.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/boskos_rbac.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/config_updater_rbac.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/deck_rbac.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/hook_rbac.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/horologium_rbac.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/jenkins_operator_rbac.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/plank_rbac.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/sinker_rbac.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/statusreconciler_rbac.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/tide_rbac.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/tracer_rbac.yaml
.PHONY: prow-rbac
prow-services:
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/prow-priority-class.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/boskos.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/boskos_reaper.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/boskos_metrics.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/adapter_imagestreams.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/artifact-uploader.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/cherrypick.yaml
$(MAKE) applyTemplate WHAT=cluster/ci/config/prow/openshift/deck.yaml
oc create secret generic deck-extensions --from-file=cluster/ci/config/prow/deck/extensions/ -o yaml --dry-run | oc apply -f - -n ci
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/ghproxy.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/hook.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/horologium.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/jenkins_operator.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/needs_rebase.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/plank.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/refresh.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/sinker.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/statusreconciler.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/tide.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/tot.yaml
$(MAKE) applyTemplate WHAT=cluster/ci/config/prow/openshift/tracer.yaml
.PHONY: prow-services
prow-cluster-jobs:
oc create configmap cluster-profile-gcp --from-file=cluster/test-deploy/gcp/vars.yaml --from-file=cluster/test-deploy/gcp/vars-origin.yaml -o yaml --dry-run | oc apply -f -
oc create configmap cluster-profile-gcp-crio --from-file=cluster/test-deploy/gcp-crio/vars.yaml --from-file=cluster/test-deploy/gcp-crio/vars-origin.yaml -o yaml --dry-run | oc apply -f -
oc create configmap cluster-profile-gcp-ha --from-file=cluster/test-deploy/gcp/vars.yaml --from-file=cluster/test-deploy/gcp/vars-origin.yaml -o yaml --dry-run | oc apply -f -
oc create configmap cluster-profile-gcp-logging --from-file=cluster/test-deploy/gcp-logging/vars.yaml --from-file=cluster/test-deploy/gcp-logging/vars-origin.yaml -o yaml --dry-run | oc apply -f -
oc create configmap cluster-profile-gcp-ha-static --from-file=cluster/test-deploy/gcp/vars.yaml --from-file=cluster/test-deploy/gcp/vars-origin.yaml -o yaml --dry-run | oc apply -f -
oc create configmap cluster-profile-aws-centos-40 --from-file=cluster/test-deploy/aws-4.0/vars.yaml -o yaml --dry-run | oc apply -f -
oc create configmap cluster-profile-aws-centos --from-file=cluster/test-deploy/aws-centos/vars.yaml --from-file=cluster/test-deploy/aws-centos/vars-origin.yaml -o yaml --dry-run | oc apply -f -
oc create configmap cluster-profile-aws-atomic --from-file=cluster/test-deploy/aws-atomic/vars.yaml --from-file=cluster/test-deploy/aws-atomic/vars-origin.yaml -o yaml --dry-run | oc apply -f -
oc create configmap cluster-profile-aws-gluster --from-file=cluster/test-deploy/aws-gluster/vars.yaml --from-file=cluster/test-deploy/aws-gluster/vars-origin.yaml -o yaml --dry-run | oc apply -f -
oc create configmap prow-job-cluster-launch-e2e --from-file=ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e.yaml -o yaml --dry-run | oc apply -f -
oc create configmap prow-job-cluster-launch-e2e-openshift-jenkins --from-file=ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-openshift-jenkins.yaml -o yaml --dry-run | oc apply -f -
oc create configmap prow-job-cluster-launch-src --from-file=ci-operator/templates/openshift/openshift-ansible/cluster-launch-src.yaml -o yaml --dry-run | oc apply -f -
oc create configmap prow-job-cluster-launch-installer-e2e --from-file=ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml -o yaml --dry-run | oc apply -f -
oc create configmap prow-job-cluster-launch-installer-libvirt-e2e --from-file=ci-operator/templates/openshift/installer/cluster-launch-installer-libvirt-e2e.yaml -o yaml --dry-run | oc apply -f -
oc create configmap prow-job-cluster-launch-installer-src --from-file=ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml -o yaml --dry-run | oc apply -f -
oc create configmap prow-job-cluster-launch-installer-console --from-file=ci-operator/templates/openshift/installer/cluster-launch-installer-console.yaml -o yaml --dry-run | oc apply -f -
oc create configmap prow-job-cluster-scaleup-openshift-ansible-e2e --from-file=ci-operator/templates/openshift/openshift-ansible/cluster-scaleup-e2e-40.yaml -o yaml --dry-run | oc apply -f -
oc create configmap prow-job-master-sidecar-4.2 --from-file=ci-operator/templates/master-sidecar-4.2.yaml -o yaml --dry-run | oc apply -f -
oc create configmap prow-job-master-sidecar-3 --from-file=ci-operator/templates/master-sidecar-3.yaml -o yaml --dry-run | oc apply -f -
.PHONY: prow-cluster-jobs
prow-ocp-rpm-secrets:
oc create secret generic base-4-1-repos \
--from-file=cluster/test-deploy/gcp/ops-mirror.pem \
--from-file=ci-operator/infra/openshift/release-controller/repos/ocp-4.1-default.repo \
-o yaml --dry-run | oc apply -n ocp -f -
oc create secret generic base-4-2-repos \
--from-file=cluster/test-deploy/gcp/ops-mirror.pem \
--from-file=ci-operator/infra/openshift/release-controller/repos/ocp-4.2-default.repo \
-o yaml --dry-run | oc apply -n ocp -f -
oc create secret generic base-openstack-4-2-repos \
--from-file=cluster/test-deploy/gcp/ops-mirror.pem \
--from-file=ci-operator/infra/openshift/release-controller/repos/ocp-4.2-openstack.repo \
-o yaml --dry-run | oc apply -n ocp -f -
oc create secret generic base-4-3-repos \
--from-file=cluster/test-deploy/gcp/ops-mirror.pem \
--from-file=ci-operator/infra/openshift/release-controller/repos/ocp-4.3-default.repo \
-o yaml --dry-run | oc apply -n ocp -f -
oc create secret generic base-openstack-4-3-repos \
--from-file=cluster/test-deploy/gcp/ops-mirror.pem \
--from-file=ci-operator/infra/openshift/release-controller/repos/ocp-4.3-openstack.repo \
-o yaml --dry-run | oc apply -n ocp -f -
.PHONY: prow-ocp-rpms-secrets
prow-jobs: prow-cluster-jobs prow-artifacts
$(MAKE) apply WHAT=projects/prometheus/test/build.yaml
$(MAKE) apply WHAT=ci-operator/templates/os.yaml
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/ci-operator/roles.yaml
.PHONY: prow-jobs
prow-artifacts:
oc create ns ci-pr-images -o yaml --dry-run | oc apply -f -
oc policy add-role-to-group system:image-puller system:unauthenticated -n ci-pr-images
oc policy add-role-to-group system:image-puller system:authenticated -n ci-pr-images
oc tag --source=docker centos:7 openshift/centos:7 --scheduled
oc create ns ci-rpms -o yaml --dry-run | oc apply -f -
oc apply -f ci-operator/infra/openshift/origin/
.PHONY: prow-artifacts
prow-release-controller-definitions:
oc annotate -n origin is/4.1 "release.openshift.io/config=$$(cat ci-operator/infra/openshift/release-controller/releases/release-origin-4.1.json)" --overwrite
oc annotate -n ocp is/4.1-art-latest "release.openshift.io/config=$$(cat ci-operator/infra/openshift/release-controller/releases/release-ocp-4.1.json)" --overwrite
oc annotate -n ocp is/4.1 "release.openshift.io/config=$$(cat ci-operator/infra/openshift/release-controller/releases/release-ocp-4.1-ci.json)" --overwrite
oc annotate -n origin is/4.2 "release.openshift.io/config=$$(cat ci-operator/infra/openshift/release-controller/releases/release-origin-4.2.json)" --overwrite
oc annotate -n ocp is/4.2-art-latest "release.openshift.io/config=$$(cat ci-operator/infra/openshift/release-controller/releases/release-ocp-4.2.json)" --overwrite
oc annotate -n ocp is/4.2 "release.openshift.io/config=$$(cat ci-operator/infra/openshift/release-controller/releases/release-ocp-4.2-ci.json)" --overwrite
oc annotate -n ocp is/release "release.openshift.io/config=$$(cat ci-operator/infra/openshift/release-controller/releases/release-ocp-4.y-stable.json)" --overwrite
.PHONY: prow-release-controller-definitions
prow-release-controller-deploy:
$(MAKE) apply WHAT=ci-operator/infra/openshift/release-controller/
.PHONY: prow-release-controller-deploy
prow-release-controller: prow-release-controller-definitions prow-release-controller-deploy
.PHONY: prow-release-controller
projects: ci-ns gcsweb origin-stable origin-release publishing-bot content-mirror azure azure-private python-validation metering
.PHONY: projects
content-mirror:
$(MAKE) apply WHAT=projects/content-mirror/pipeline.yaml
.PHONY: content-mirror
node-problem-detector:
$(MAKE) apply WHAT=projects/kubernetes/node-problem-detector.yaml
.PHONY: node-problem-detector
gcsweb:
$(MAKE) applyTemplate WHAT=projects/gcsweb/pipeline.yaml
.PHONY: gcsweb
kube-state-metrics:
$(MAKE) apply WHAT=projects/kube-state-metrics/pipeline.yaml
.PHONY: kube-state-metrics
oauth-proxy:
$(MAKE) apply WHAT=projects/oauth-proxy/pipeline.yaml
.PHONY: oauth-proxy
publishing-bot:
$(MAKE) apply WHAT=projects/publishing-bot/storage-class.yaml
.PHONY: publishing-bot
origin-stable:
$(MAKE) apply WHAT=projects/origin-stable/release.yaml
$(MAKE) apply WHAT=projects/origin-stable/stable-3.9.yaml
$(MAKE) apply WHAT=projects/origin-stable/stable-3.10.yaml
.PHONY: origin-stable
origin-release:
$(MAKE) applyTemplate WHAT=projects/origin-release/pipeline.yaml
oc tag docker.io/centos/ruby-25-centos7:latest --scheduled openshift/release:ruby-25
.PHONY: origin-release
prometheus: node-exporter alert-buffer
$(MAKE) apply WHAT=projects/prometheus/prometheus.yaml
.PHONY: prometheus
python-validation:
$(MAKE) apply WHAT=projects/origin-release/python-validation/python-validation.yaml
.PHONY: python-validation
node-exporter:
$(MAKE) apply WHAT=projects/prometheus/node_exporter.yaml
.PHONY: node-exporter
service-idler:
$(MAKE) apply WHAT=projects/service-idler/pipeline.yaml
.PHONY: service-idler
alert-buffer:
$(MAKE) apply WHAT=projects/prometheus/alert-buffer.yaml
.PHONY: alert-buffer
cluster-operator-roles:
oc create ns openshift-cluster-operator --dry-run -o yaml | oc apply -f -
$(MAKE) apply WHAT=projects/cluster-operator/cluster-operator-team-roles.yaml
$(MAKE) applyTemplate WHAT=projects/cluster-operator/cluster-operator-roles-template.yaml
.PHONY: cluster-operator-roles
azure:
# set up azure namespace and policies
$(MAKE) apply WHAT=projects/azure/cluster-wide.yaml
$(MAKE) apply WHAT=projects/azure/rbac.yaml
# the rest of the config
$(MAKE) apply WHAT=projects/azure/azure-purge/
$(MAKE) apply WHAT=projects/azure/base-images/
$(MAKE) apply WHAT=projects/azure/image-mirror/
$(MAKE) apply WHAT=projects/azure/secret-refresh/
.PHONY: azure
azure-secrets:
oc create secret generic cluster-secrets-azure \
--from-file=cluster/test-deploy/azure/secret \
--from-file=cluster/test-deploy/azure/ssh-privatekey \
--from-file=cluster/test-deploy/azure/certs.yaml \
--from-file=cluster/test-deploy/azure/.dockerconfigjson \
--from-file=cluster/test-deploy/azure/system-docker-config.json \
--from-file=cluster/test-deploy/azure/logging-int.cert \
--from-file=cluster/test-deploy/azure/logging-int.key \
--from-file=cluster/test-deploy/azure/metrics-int.cert \
--from-file=cluster/test-deploy/azure/metrics-int.key \
-o yaml --dry-run | oc apply -n azure -f -
oc create secret generic aws-reg-master --from-literal=username=${AWS_REG_USERNAME} --from-literal=password=${AWS_REG_PASSWORD} -o yaml --dry-run | oc apply -n azure -f -
oc create secret generic codecov-token --from-literal=upload=${CODECOV_UPLOAD_TOKEN} -o yaml --dry-run | oc apply -n azure -f -
oc create secret generic cluster-secrets-azure-env --from-literal=azure_client_id=${AZURE_ROOT_CLIENT_ID} --from-literal=azure_client_secret=${AZURE_ROOT_CLIENT_SECRET} --from-literal=azure_tenant_id=${AZURE_ROOT_TENANT_ID} --from-literal=azure_subscription_id=${AZURE_ROOT_SUBSCRIPTION_ID} -o yaml --dry-run | oc apply -n azure-private -f -
.PHONY: azure-secrets
azure4-secrets:
oc create secret generic cluster-secrets-azure4 \
--from-file=cluster/test-deploy/azure4/osServicePrincipal.json \
--from-file=cluster/test-deploy/azure4/pull-secret \
--from-file=cluster/test-deploy/azure4/ssh-privatekey \
--from-file=cluster/test-deploy/azure4/ssh-publickey \
-o yaml --dry-run | oc apply -n ocp -f -
.PHONY: azure4-secrets
metering:
$(MAKE) -C projects/metering
.PHONY: metering
metal-secrets:
oc create secret generic cluster-secrets-metal \
--from-file=cluster/test-deploy/metal/.awscred \
--from-file=cluster/test-deploy/metal/.packetcred \
--from-file=cluster/test-deploy/metal/matchbox-client.crt \
--from-file=cluster/test-deploy/metal/matchbox-client.key \
--from-file=cluster/test-deploy/metal/ssh-privatekey \
--from-file=cluster/test-deploy/metal/ssh-publickey \
--from-file=cluster/test-deploy/metal/pull-secret \
-o yaml --dry-run | oc apply -n ocp -f -
.PHONY: metal-secrets
check-prow-config:
# test that the prow config is parseable
mkpj --config-path cluster/ci/config/prow/config.yaml --job-config-path ci-operator/jobs/ --job branch-ci-origin-images --base-ref master --base-sha abcdef
.PHONY: check-prow-config
libpod:
$(MAKE) apply WHAT=projects/libpod/libpod.yaml
.PHONY: libpod
cincinnati:
$(MAKE) apply WHAT=projects/cincinnati/cincinnati.yaml
.PHONY: cincinnati
prow-monitoring:
make -C cluster/ci/monitoring prow-monitoring-deploy
.PHONY: prow-monitoring
build-dashboards-validation-image:
oc apply -f projects/origin-release/dashboards-validation/dashboards-validation.yaml
.PHONY: build-dashboards-validation-image
logging:
$(MAKE) apply WHAT=cluster/ci/config/logging/fluentd-daemonset.yaml
$(MAKE) apply WHAT=cluster/ci/config/logging/fluentd-configmap.yaml
.PHONY: logging