forked from openstack-k8s-operators/install_yamls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
618 lines (525 loc) · 27.2 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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
# general
SHELL := /bin/bash
NAMESPACE ?= openstack
PASSWORD ?= 12345678
SECRET ?= osp-secret
OUT ?= ${PWD}/out
# operators gets cloned here
OPERATOR_BASE_DIR ?= ${OUT}/operator
# default registry and org to pull service images from
SERVICE_REGISTRY ?= quay.io
SERVICE_ORG ?= tripleowallabycentos9
# storage (used by some operators)
STORAGE_CLASS ?= "local-storage"
# OpenStack Operator
OPENSTACK_IMG ?= quay.io/openstack-k8s-operators/openstack-operator-index:latest
OPENSTACK_REPO ?= https://github.com/openstack-k8s-operators/openstack-operator.git
OPENSTACK_BRANCH ?= master
OPENSTACK_CTLPLANE ?= config/samples/core_v1beta1_openstackcontrolplane.yaml
OPENSTACK_CR ?= ${OPERATOR_BASE_DIR}/openstack-operator/${OPENSTACK_CTLPLANE}
# Keystone
KEYSTONE_IMG ?= quay.io/openstack-k8s-operators/keystone-operator-index:latest
KEYSTONE_REPO ?= https://github.com/openstack-k8s-operators/keystone-operator.git
KEYSTONE_BRANCH ?= master
KEYSTONEAPI ?= config/samples/keystone_v1beta1_keystoneapi.yaml
KEYSTONEAPI_CR ?= ${OPERATOR_BASE_DIR}/keystone-operator/${KEYSTONEAPI}
KEYSTONEAPI_IMG ?= ${SERVICE_REGISTRY}/${SERVICE_ORG}/openstack-keystone:current-tripleo
# Mariadb
MARIADB_IMG ?= quay.io/openstack-k8s-operators/mariadb-operator-index:latest
MARIADB_REPO ?= https://github.com/openstack-k8s-operators/mariadb-operator.git
MARIADB_BRANCH ?= master
MARIADB ?= config/samples/mariadb_v1beta1_mariadb.yaml
MARIADB_CR ?= ${OPERATOR_BASE_DIR}/mariadb-operator/${MARIADB}
MARIADB_DEPL_IMG ?= ${SERVICE_REGISTRY}/${SERVICE_ORG}/openstack-mariadb:current-tripleo
# Placement
PLACEMENT_IMG ?= quay.io/openstack-k8s-operators/placement-operator-index:latest
PLACEMENT_REPO ?= https://github.com/openstack-k8s-operators/placement-operator.git
PLACEMENT_BRANCH ?= master
PLACEMENTAPI ?= config/samples/placement_v1beta1_placementapi.yaml
PLACEMENTAPI_CR ?= ${OPERATOR_BASE_DIR}/placement-operator/${PLACEMENTAPI}
PLACEMENTAPI_IMG ?= ${SERVICE_REGISTRY}/${SERVICE_ORG}/openstack-placement-api:current-tripleo
# Sir Glancealot
GLANCE_IMG ?= quay.io/openstack-k8s-operators/glance-operator-index:latest
GLANCE_REPO ?= https://github.com/openstack-k8s-operators/glance-operator.git
GLANCE_BRANCH ?= master
GLANCE ?= config/samples/glance_v1beta1_glance.yaml
GLANCE_CR ?= ${OPERATOR_BASE_DIR}/glance-operator/${GLANCE}
GLANCEAPI_IMG ?= ${SERVICE_REGISTRY}/${SERVICE_ORG}/openstack-glance-api:current-tripleo
# Neutron
NEUTRON_IMG ?= quay.io/openstack-k8s-operators/neutron-operator-index:latest
NEUTRON_REPO ?= https://github.com/openstack-k8s-operators/neutron-operator.git
NEUTRON_BRANCH ?= master
NEUTRONAPI ?= config/samples/neutron_v1beta1_neutronapi.yaml
NEUTRONAPI_CR ?= ${OPERATOR_BASE_DIR}/neutron-operator/${NEUTRONAPI}
NEUTRONAPI_IMG ?= ${SERVICE_REGISTRY}/${SERVICE_ORG}/openstack-neutron-server:current-tripleo
# Cinder
CINDER_IMG ?= quay.io/openstack-k8s-operators/cinder-operator-index:latest
CINDER_REPO ?= https://github.com/openstack-k8s-operators/cinder-operator.git
CINDER_BRANCH ?= master
CINDER ?= config/samples/cinder_v1beta1_cinder.yaml
CINDER_CR ?= ${OPERATOR_BASE_DIR}/cinder-operator/${CINDER}
# TODO: Image customizations for all Cinder services
# Rabbitmq
RABBITMQ_IMG ?= quay.io/openstack-k8s-operators/rabbitmq-cluster-operator-index:latest
RABBITMQ_REPO ?= https://github.com/openstack-k8s-operators/rabbitmq-cluster-operator.git
RABBITMQ_BRANCH ?= patches
RABBITMQ ?= docs/examples/default-security-context/rabbitmq.yaml
RABBITMQ_CR ?= ${OPERATOR_BASE_DIR}/rabbitmq-operator/${RABBITMQ}
# Ironic
IRONIC_IMG ?= quay.io/openstack-k8s-operators/ironic-operator-index:latest
IRONIC_REPO ?= https://github.com/openstack-k8s-operators/ironic-operator.git
IRONIC_BRANCH ?= master
IRONIC ?= config/samples/ironic_v1beta1_ironic.yaml
IRONIC_CR ?= ${OPERATOR_BASE_DIR}/ironic-operator/${IRONIC}
# Octavia
OCTAVIA_IMG ?= quay.io/openstack-k8s-operators/octavia-operator-index:latest
OCTAVIA_REPO ?= https://github.com/openstack-k8s-operators/octavia-operator.git
OCTAVIA_BRANCH ?= main
OCTAVIAAPI ?= config/samples/octavia_v1beta1_octaviaapi.yaml
OCTAVIAAPI_CR ?= ${OPERATOR_BASE_DIR}/octavia-operator/${OCTAVIAAPI}
OCTAVIAAPI_IMG ?= ${SERVICE_REGISTRY}/${SERVICE_ORG}/openstack-octavia:current-tripleo
# Nova
NOVA_IMG ?= quay.io/openstack-k8s-operators/nova-operator-index:latest
NOVA_REPO ?= https://github.com/openstack-k8s-operators/nova-operator.git
NOVA_BRANCH ?= master
NOVA ?= config/samples/nova_v1beta1_nova.yaml
NOVA_CR ?= ${OPERATOR_BASE_DIR}/nova-operator/${NOVA}
# target vars for generic operator install info 1: target name , 2: operator name
define vars
${1}: export NAMESPACE=${NAMESPACE}
${1}: export SECRET=${SECRET}
${1}: export PASSWORD=${PASSWORD}
${1}: export STORAGE_CLASS=${STORAGE_CLASS}
${1}: export OUT=${OUT}
${1}: export OPERATOR_NAME=${2}
${1}: export OPERATOR_DIR=${OUT}/${NAMESPACE}/${2}/op
${1}: export DEPLOY_DIR=${OUT}/${NAMESPACE}/${2}/cr
endef
.PHONY: all
all: namespace keystone mariadb placement neutron
##@ General
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
# target descriptions by '##'. The awk commands is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
# More info on the usage of ANSI control characters for terminal formatting:
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
# More info on the awk command:
# http://linuxcommand.org/lc3_adv_awk.php
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: cleanup
cleanup: nova_cleanup octavia_cleanup neutron_cleanup ironic_cleanup cinder_cleanup glance_cleanup placement_cleanup keystone_cleanup mariadb_cleanup ## Delete all operators
.PHONY: deploy_cleanup
deploy_cleanup: nova_deploy_cleanup octavia_deploy_cleanup neutron_deploy_cleanup ironic_deploy_cleanup cinder_deploy_cleanup glance_deploy_cleanup placement_deploy_cleanup keystone_deploy_cleanup mariadb_deploy_cleanup ## Delete all OpenStack service objects
##@ CRC
crc_storage: ## initialize local storage PVs in CRC vm
bash scripts/create-pv.sh
bash scripts/gen-crc-pv-kustomize.sh
oc kustomize ${OUT}/crc | oc apply -f -
crc_storage_cleanup: ## cleanup local storage PVs in CRC vm
oc get pv | grep local | cut -f 1 -d ' ' | xargs oc delete pv
oc delete sc local-storage
bash scripts/delete-pv.sh
##@ NAMESPACE
.PHONY: namespace
namespace: ## creates the namespace specified via NAMESPACE env var (defaults to openstack)
$(eval $(call vars,$@))
bash scripts/gen-namespace.sh
oc apply -f ${OUT}/${NAMESPACE}/namespace.yaml
sleep 2
oc project ${NAMESPACE}
.PHONY: namespace_cleanup
namespace_cleanup: ## deletes the namespace specified via NAMESPACE env var, also runs cleanup for all services to cleanup the namespace prior delete it.
$(eval $(call vars,$@))
make keystone_cleanup
make mariadb_cleanup
oc delete project ${NAMESPACE}
rm -Rf ${OUT}/${NAMESPACE}
##@ SERVICE INPUT
.PHONY: input
input: ## creates required secret/CM, used by the services as input
$(eval $(call vars,$@))
bash scripts/gen-input-kustomize.sh ${NAMESPACE} ${SECRET} ${PASSWORD}
oc get secret/${SECRET} || oc kustomize ${OUT}/${NAMESPACE}/input | oc apply -f -
.PHONY: input_cleanup
input_cleanup: ## deletes the secret/CM, used by the services as input
oc kustomize ${OUT}/${NAMESPACE}/input | oc delete --ignore-not-found=true -f -
rm -Rf ${OUT}/${NAMESPACE}/input
##@ OPENSTACK
.PHONY: openstack_prep
openstack_prep: export IMAGE=${OPENSTACK_IMG}
openstack_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,openstack))
bash scripts/gen-olm.sh
.PHONY: openstack
openstack: namespace openstack_prep ## installs the operator, also runs the prep step. Set OPENSTACK_IMG for custom image.
$(eval $(call vars,$@,openstack))
oc apply -f ${OPERATOR_DIR}
.PHONY: openstack_cleanup
openstack_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,openstack))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: openstack_deploy_prep
openstack_deploy_prep: export KIND=OpenStackControlPlane
openstack_deploy_prep: export IMAGE=unused
openstack_deploy_prep: openstack_deploy_cleanup ## prepares the CR to install the service based on the service sample file OPENSTACK
$(eval $(call vars,$@,openstack))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${OPENSTACK_BRANCH} ${OPENSTACK_REPO} && popd
cp ${OPENSTACK_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: openstack_deploy
openstack_deploy: input openstack_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set OPENSTACK_REPO and OPENSTACK_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,openstack))
oc kustomize ${DEPLOY_DIR} | oc apply -f -
.PHONY: openstack_deploy_cleanup
openstack_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,openstack))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/openstack-operator ${DEPLOY_DIR}
##@ KEYSTONE
.PHONY: keystone_prep
keystone_prep: export IMAGE=${KEYSTONE_IMG}
keystone_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,keystone))
bash scripts/gen-olm.sh
.PHONY: keystone
keystone: namespace keystone_prep ## installs the operator, also runs the prep step. Set KEYSTONE_IMG for custom image.
$(eval $(call vars,$@,keystone))
oc apply -f ${OPERATOR_DIR}
.PHONY: keystone_cleanup
keystone_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,keystone))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: keystone_deploy_prep
keystone_deploy_prep: export KIND=KeystoneAPI
keystone_deploy_prep: export IMAGE=${KEYSTONEAPI_IMG}
keystone_deploy_prep: keystone_deploy_cleanup ## prepares the CR to install the service based on the service sample file KEYSTONEAPI
$(eval $(call vars,$@,keystone))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${KEYSTONE_BRANCH} ${KEYSTONE_REPO} && popd
cp ${KEYSTONEAPI_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: keystone_deploy
keystone_deploy: input keystone_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set KEYSTONE_REPO and KEYSTONE_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,keystone))
oc kustomize ${DEPLOY_DIR} | oc apply -f -
.PHONY: keystone_deploy_cleanup
keystone_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,keystone))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/keystone-operator ${DEPLOY_DIR}
oc rsh -t mariadb-openstack mysql -u root --password=${PASSWORD} -e "drop database keystone;" || true
##@ MARIADB
mariadb_prep: export IMAGE=${MARIADB_IMG}
mariadb_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,mariadb))
bash scripts/gen-olm.sh
.PHONY: mariadb
mariadb: namespace mariadb_prep ## installs the operator, also runs the prep step. Set MARIADB_IMG for custom image.
$(eval $(call vars,$@,mariadb))
oc apply -f ${OPERATOR_DIR}
.PHONY: mariadb_cleanup
mariadb_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,mariadb))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: mariadb_deploy_prep
mariadb_deploy_prep: export KIND=MariaDB
mariadb_deploy_prep: export IMAGE="${MARIADB_DEPL_IMG}"
mariadb_deploy_prep: mariadb_deploy_cleanup ## prepares the CRs files to install the service based on the service sample file MARIADB
$(eval $(call vars,$@,mariadb))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${MARIADB_BRANCH} ${MARIADB_REPO} && popd
cp ${MARIADB_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: mariadb_deploy
mariadb_deploy: input mariadb_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set MARIADB_REPO and MARIADB_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,mariadb))
oc kustomize ${DEPLOY_DIR} | oc apply -f -
.PHONY: mariadb_deploy_cleanup
mariadb_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,mariadb))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/mariadb-operator ${DEPLOY_DIR}
##@ PLACEMENT
.PHONY: placement_prep
placement_prep: export IMAGE=${PLACEMENT_IMG}
placement_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,placement))
bash scripts/gen-olm.sh
.PHONY: placement
placement: namespace placement_prep ## installs the operator, also runs the prep step. Set PLACEMENT_IMG for custom image.
$(eval $(call vars,$@,placement))
oc apply -f ${OPERATOR_DIR}
.PHONY: placement_cleanup
placement_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,placement))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: placement_deploy_prep
placement_deploy_prep: export KIND=PlacementAPI
placement_deploy_prep: export IMAGE=${PLACEMENTAPI_IMG}
placement_deploy_prep: placement_deploy_cleanup ## prepares the CR to install the service based on the service sample file PLACEMENTAPI
$(eval $(call vars,$@,placement))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${PLACEMENT_BRANCH} ${PLACEMENT_REPO} && popd
cp ${PLACEMENTAPI_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: placement_deploy
placement_deploy: input placement_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set PLACEMENT_REPO and PLACEMENT_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,placement))
oc kustomize ${DEPLOY_DIR} | oc apply -f -
.PHONY: placement_deploy_cleanup
placement_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,placement))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/placement-operator ${DEPLOY_DIR}
oc rsh -t mariadb-openstack mysql -u root --password=${PASSWORD} -e "drop database placement;" || true
##@ GLANCE
.PHONY: glance_prep
glance_prep: export IMAGE=${GLANCE_IMG}
glance_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,glance))
bash scripts/gen-olm.sh
.PHONY: glance
glance: namespace glance_prep ## installs the operator, also runs the prep step. Set GLANCE_IMG for custom image.
$(eval $(call vars,$@,glance))
oc apply -f ${OPERATOR_DIR}
.PHONY: glance_cleanup
glance_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,glance))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: glance_deploy_prep
glance_deploy_prep: export KIND=Glance
glance_deploy_prep: export IMAGE=${GLANCEAPI_IMG}
glance_deploy_prep: glance_deploy_cleanup ## prepares the CR to install the service based on the service sample file GLANCE
$(eval $(call vars,$@,glance))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${GLANCE_BRANCH} ${GLANCE_REPO} && popd
cp ${GLANCE_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: glance_deploy
glance_deploy: input glance_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set GLANCE_REPO and GLANCE_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,glance))
oc kustomize ${DEPLOY_DIR} | oc apply -f -
.PHONY: glance_deploy_cleanup
glance_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,glance))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/glance-operator ${DEPLOY_DIR}
oc rsh -t mariadb-openstack mysql -u root --password=${PASSWORD} -e "drop database glance;" || true
##@ NEUTRON
.PHONY: neutron_prep
neutron_prep: export IMAGE=${NEUTRON_IMG}
neutron_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,neutron))
bash scripts/gen-olm.sh
.PHONY: neutron
neutron: namespace neutron_prep ## installs the operator, also runs the prep step. Set NEUTRON_IMG for custom image.
$(eval $(call vars,$@,neutron))
oc apply -f ${OPERATOR_DIR}
.PHONY: neutron_cleanup
neutron_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,neutron))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: neutron_deploy_prep
neutron_deploy_prep: export KIND=NeutronAPI
neutron_deploy_prep: export IMAGE=${NEUTRONAPI_IMG}
neutron_deploy_prep: neutron_deploy_cleanup ## prepares the CR to install the service based on the service sample file NEUTRONAPI
$(eval $(call vars,$@,neutron))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${NEUTRON_BRANCH} ${NEUTRON_REPO} && popd
cp ${NEUTRONAPI_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: neutron_deploy
neutron_deploy: input neutron_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set NEUTRON_REPO and NEUTRON_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,neutron))
oc kustomize ${DEPLOY_DIR} | oc apply -f -
.PHONY: neutron_deploy_cleanup
neutron_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,neutron))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/neutron-operator ${DEPLOY_DIR}
oc rsh -t mariadb-openstack mysql -u root --password=${PASSWORD} -e "drop database neutron;" || true
##@ CINDER
.PHONY: cinder_prep
cinder_prep: export IMAGE=${CINDER_IMG}
cinder_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,cinder))
bash scripts/gen-olm.sh
.PHONY: cinder
cinder: namespace cinder_prep ## installs the operator, also runs the prep step. Set CINDER_IMG for custom image.
$(eval $(call vars,$@,cinder))
oc apply -f ${OPERATOR_DIR}
.PHONY: cinder_cleanup
cinder_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,cinder))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: cinder_deploy_prep
cinder_deploy_prep: export KIND=Cinder
cinder_deploy_prep: export IMAGE=unused
cinder_deploy_prep: cinder_deploy_cleanup ## prepares the CR to install the service based on the service sample file CINDER
$(eval $(call vars,$@,cinder))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${CINDER_BRANCH} ${CINDER_REPO} && popd
cp ${CINDER_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: cinder_deploy
cinder_deploy: input cinder_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set CINDER_REPO and CINDER_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,cinder))
oc kustomize ${DEPLOY_DIR} | oc apply -f -
.PHONY: cinder_deploy_cleanup
cinder_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,cinder))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/cinder-operator ${DEPLOY_DIR}
oc rsh -t mariadb-openstack mysql -u root --password=${PASSWORD} -e "drop database cinder;" || true
##@ RABBITMQ
.PHONY: rabbitmq_prep
rabbitmq_prep: export IMAGE=${RABBITMQ_IMG}
rabbitmq_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,cluster))
bash scripts/gen-olm.sh
.PHONY: rabbitmq
rabbitmq: namespace rabbitmq_prep ## installs the operator, also runs the prep step. Set RABBITMQ_IMG for custom image.
$(eval $(call vars,$@,cluster))
oc apply -f ${OPERATOR_DIR}
.PHONY: rabbitmq_cleanup
rabbitmq_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,cluster))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: rabbitmq_deploy_prep
rabbitmq_deploy_prep: export KIND=RabbitmqCluster
rabbitmq_deploy_prep: rabbitmq_deploy_cleanup ## prepares the CR to install the service based on the service sample file RABBITMQ
$(eval $(call vars,$@,rabbitmq))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${RABBITMQ_BRANCH} ${RABBITMQ_REPO} rabbitmq-operator && popd
cp ${RABBITMQ_CR} ${DEPLOY_DIR}
#bash scripts/gen-service-kustomize.sh
.PHONY: rabbitmq_deploy
rabbitmq_deploy: input rabbitmq_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set RABBITMQ_REPO and RABBITMQ_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,rabbitmq))
#oc kustomize ${DEPLOY_DIR} | oc apply -f -
oc apply -f ${DEPLOY_DIR}/rabbitmq.yaml
.PHONY: rabbitmq_deploy_cleanup
rabbitmq_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,rabbitmq))
oc delete --ignore-not-found=true RabbitmqCluster default-security-context
rm -Rf ${OPERATOR_BASE_DIR}/rabbitmq-operator ${DEPLOY_DIR}
##@ IRONIC
.PHONY: ironic_prep
ironic_prep: export IMAGE=${IRONIC_IMG}
ironic_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,ironic))
bash scripts/gen-olm.sh
.PHONY: ironic
ironic: namespace ironic_prep ## installs the operator, also runs the prep step. Set IRONIC_IMG for custom image.
$(eval $(call vars,$@,ironic))
oc apply -f ${OPERATOR_DIR}
.PHONY: ironic_cleanup
ironic_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,ironic))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: ironic_deploy_prep
ironic_deploy_prep: export KIND=Ironic
ironic_deploy_prep: export IMAGE=${IRONIC_IMG}
ironic_deploy_prep: ironic_deploy_cleanup ## prepares the CR to install the service based on the service sample file IRONIC
$(eval $(call vars,$@,ironic))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${IRONIC_BRANCH} ${IRONIC_REPO} && popd
cp ${IRONIC_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: ironic_deploy
ironic_deploy: input ironic_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set IRONIC_REPO and IRONIC_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,ironic))
oc kustomize ${DEPLOY_DIR} | oc apply -f -
.PHONY: ironic_deploy_cleanup
ironic_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,ironic))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/ironic-operator ${DEPLOY_DIR}
oc rsh -t mariadb-openstack mysql -u root --password=${PASSWORD} -e "drop database ironic;" || true
##@ OCTAVIA
.PHONY: octavia_prep
octavia_prep: export IMAGE=${OCTAVIA_IMG}
octavia_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,octavia))
bash scripts/gen-olm.sh
.PHONY: octavia
octavia: namespace octavia_prep ## installs the operator, also runs the prep step. Set OCTAVIA_IMG for custom image.
$(eval $(call vars,$@,octavia))
oc apply -f ${OPERATOR_DIR}
.PHONY: octavia_cleanup
octavia_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,octavia))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: octavia_deploy_prep
octavia_deploy_prep: export KIND=OctaviaAPI
octavia_deploy_prep: export IMAGE="${OCTAVIAAPI_IMG}"
octavia_deploy_prep: octavia_deploy_cleanup ## prepares the CR to install the service based on the service sample file OCTAVIA
$(eval $(call vars,$@,octavia))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${OCTAVIA_BRANCH} ${OCTAVIA_REPO} && popd
cp ${OCTAVIAAPI_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: octavia_deploy
octavia_deploy: input octavia_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set OCTAVIA_REPO and OCTAVIA_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,octavia))
oc kustomize ${DEPLOY_DIR} | oc apply -f -
.PHONY: octavia_deploy_cleanup
octavia_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,octavia))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/octavia-operator ${DEPLOY_DIR}
oc rsh -t mariadb-openstack mysql -u root --password=${PASSWORD} -e "drop database octavia;" || true
##@ NOVA
.PHONY: nova_prep
nova_prep: export IMAGE=${NOVA_IMG}
nova_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,nova))
bash scripts/gen-olm.sh
.PHONY: nova
nova: namespace nova_prep ## installs the operator, also runs the prep step. Set NOVA_IMG for custom image.
$(eval $(call vars,$@,nova))
oc apply -f ${OPERATOR_DIR}
.PHONY: nova_cleanup
nova_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,nova))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: nova_deploy_prep
nova_deploy_prep: export KIND=Nova
# TOOD(gibi): the tooling expect a containerImage at the top level
# but for projects like Cinder and Nova where there are multiple services with
# different images this customization does not make sense. Make this
# customization optional in the tooling.
nova_deploy_prep: export IMAGE=unused
nova_deploy_prep: nova_deploy_cleanup ## prepares the CR to install the service based on the service sample file NOVA
$(eval $(call vars,$@,nova))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${NOVA_BRANCH} ${NOVA_REPO} && popd
cp ${NOVA_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: nova_deploy
nova_deploy: input nova_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set NOVA_REPO and NOVA_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,nova))
oc kustomize ${DEPLOY_DIR} | oc apply -f -
.PHONY: nova_deploy_cleanup
nova_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,nova))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/nova-operator ${DEPLOY_DIR}
oc rsh mariadb-openstack mysql -u root --password=${PASSWORD} -ss -e "show databases like 'nova_%';" | xargs -I '{}' oc rsh mariadb-openstack mysql -u root --password=${PASSWORD} -ss -e "drop database {};"