forked from openstack-k8s-operators/install_yamls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
1418 lines (1212 loc) · 66.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
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# general
SHELL := /bin/bash
NAMESPACE ?= openstack
PASSWORD ?= 12345678
SECRET ?= osp-secret
OUT ?= ${PWD}/out
INSTALL_YAMLS ?= ${PWD} # used for kuttl tests
METADATA_SHARED_SECRET ?= 1234567842
# are we deploying to microshift
MICROSHIFT ?= 0
# operators gets cloned here
OPERATOR_BASE_DIR ?= ${OUT}/operator
# storage (used by some operators)
STORAGE_CLASS ?= "local-storage"
# network isolation
NETWORK_ISOLATION ?= true
# 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 ?= $(if $(findstring true,$(NETWORK_ISOLATION)),config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml,config/samples/core_v1beta1_openstackcontrolplane.yaml)
OPENSTACK_CR ?= ${OPERATOR_BASE_DIR}/openstack-operator/${OPENSTACK_CTLPLANE}
OPENSTACK_BUNDLE_IMG ?= quay.io/openstack-k8s-operators/openstack-operator-bundle:latest
# Infra Operator
INFRA_IMG ?= quay.io/openstack-k8s-operators/infra-operator-index:latest
INFRA_REPO ?= https://github.com/openstack-k8s-operators/infra-operator.git
INFRA_BRANCH ?= master
# Memcached
# MEMCACHED_IMG ?= (tis is unused because this is part of infra operator)
MEMCACHED ?= config/samples/memcached_v1beta1_memcached.yaml
MEMCACHED_CR ?= ${OPERATOR_BASE_DIR}/infra-operator/${MEMCACHED}
MEMCACHED_DEPL_IMG ?= unused
# 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_DEPL_IMG ?= unused
KEYSTONE_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/keystone-operator/kuttl-test.yaml
KEYSTONE_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/keystone-operator/tests/kuttl/tests
# 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 ?= unused
MARIADB_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/mariadb-operator/kuttl-test.yaml
MARIADB_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/mariadb-operator/tests/kuttl/tests
# 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_DEPL_IMG ?= unused
# 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_DEPL_IMG ?= unused
GLANCE_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/glance-operator/kuttl-test.yaml
GLANCE_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/glance-operator/tests/kuttl/tests
# Ovn
OVN_IMG ?= quay.io/openstack-k8s-operators/ovn-operator-index:latest
OVN_REPO ?= https://github.com/openstack-k8s-operators/ovn-operator.git
OVN_BRANCH ?= main
OVNDBS ?= config/samples/ovn_v1beta1_ovndbcluster.yaml
OVNDBS_CR ?= ${OPERATOR_BASE_DIR}/ovn-operator/${OVNDBS}
OVNNORTHD ?= config/samples/ovn_v1beta1_ovnnorthd.yaml
OVNNORTHD_CR ?= ${OPERATOR_BASE_DIR}/ovn-operator/${OVNNORTHD}
# TODO: Image customizations for all OVN services
OVN_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/ovn-operator/kuttl-test.yaml
OVN_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/ovn-operator/tests/kuttl/tests
# Ovs
OVS_IMG ?= quay.io/openstack-k8s-operators/ovs-operator-index:latest
OVS_REPO ?= https://github.com/openstack-k8s-operators/ovs-operator.git
OVS_BRANCH ?= main
OVS ?= config/samples/ovs_v1beta1_ovs.yaml
OVS_CR ?= ${OPERATOR_BASE_DIR}/ovs-operator/${OVS}
# TODO: Image customizations for all OVS services
OVS_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/ovs-operator/kuttl-test.yaml
OVS_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/ovs-operator/tests/kuttl/tests
# 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_DEPL_IMG ?= unused
# TODO: Do we need interfaces to customize images for the other services ?
NEUTRON_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/neutron-operator/kuttl-test.yaml
NEUTRON_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/neutron-operator/test/kuttl/tests
# 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
CINDER_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/cinder-operator/kuttl-test.yaml
CINDER_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/cinder-operator/tests/kuttl/tests
# 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}
# TODO: Image customizations for all RabbitMQ services
# 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}
# TODO: Image customizations for all Ironic services
IRONIC_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/ironic-operator/kuttl-test.yaml
IRONIC_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/ironic-operator/tests/kuttl/tests
# 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
OCTAVIA ?= config/samples/octavia_v1beta1_octavia.yaml
OCTAVIA_CR ?= ${OPERATOR_BASE_DIR}/octavia-operator/${OCTAVIA}
# TODO: Image customizations for all Octavia services
OCTAVIA_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/octavia-operator/kuttl-test.yaml
OCTAVIA_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/octavia-operator/tests/kuttl/tests
# 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
# NOTE(gibi): We intentionally not using the default nova sample here
# as that would require two RabbitMQCluster to be deployed which a) is not what
# the make rabbitmq_deploy target does ii) required extra resource in the dev
# environment.
NOVA ?= config/samples/nova_v1beta1_nova_collapsed_cell.yaml
NOVA_CR ?= ${OPERATOR_BASE_DIR}/nova-operator/${NOVA}
# TODO: Image customizations for all Nova services
# Horizon
HORIZON_IMG ?= quay.io/openstack-k8s-operators/horizon-operator-index:latest
HORIZON_REPO ?= https://github.com/openstack-k8s-operators/horizon-operator.git
HORIZON_BRANCH ?= main
HORIZON ?= config/samples/horizon_v1alpha1_horizon.yaml
HORIZON_CR ?= ${OPERATOR_BASE_DIR}/horizon-operator/${HORIZON}
HORIZON_DEPL_IMG ?= unused
# Heat
HEAT_IMG ?= quay.io/openstack-k8s-operators/heat-operator-index:latest
HEAT_REPO ?= https://github.com/openstack-k8s-operators/heat-operator.git
HEAT_BRANCH ?= main
HEAT ?= config/samples/heat_v1beta1_heat.yaml
HEAT_CR ?= ${OPERATOR_BASE_DIR}/heat-operator/${HEAT}
# TODO: Image customizations for all Heat services
HEAT_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/heat-operator/kuttl-test.yaml
HEAT_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/heat-operator/tests/kuttl/tests
# AnsibleEE
ANSIBLEEE_IMG ?= quay.io/openstack-k8s-operators/openstack-ansibleee-operator-index:latest
ANSIBLEEE_REPO ?= https://github.com/openstack-k8s-operators/openstack-ansibleee-operator
ANSIBLEEE_BRANCH ?= main
ANSIBLEEE ?= config/samples/_v1alpha1_ansibleee.yaml
ANSIBLEEE_CR ?= ${OPERATOR_BASE_DIR}/openstack-ansibleee-operator/${ANSIBLEEE}
ANSIBLEEE_KUTTL_CONF ?= ${OPERATOR_BASE_DIR}/openstack-ansibleee-operator/kuttl-test.yaml
ANSIBLEEE_KUTTL_DIR ?= ${OPERATOR_BASE_DIR}/openstack-ansibleee-operator/tests/kuttl/tests
# Baremetal Operator
BAREMETAL_IMG ?= quay.io/openstack-k8s-operators/openstack-baremetal-operator-index:latest
BAREMETAL_REPO ?= https://github.com/openstack-k8s-operators/openstack-baremetal-operator.git
BAREMETAL_BRANCH ?= master
# Dataplane Operator
DATAPLANE_IMG ?= quay.io/openstack-k8s-operators/dataplane-operator-index:latest
DATAPLANE_REPO ?= https://github.com/openstack-k8s-operators/dataplane-operator.git
DATAPLANE_BRANCH ?= main
OPENSTACK_DATAPLANE ?= config/samples/dataplane_v1beta1_openstackdataplane.yaml
DATAPLANE_CR ?= ${OPERATOR_BASE_DIR}/dataplane-operator/${OPENSTACK_DATAPLANE}
DATAPLANE_ANSIBLE_SECRET ?=dataplane-ansible-ssh-private-key-secret
DATAPLANE_COMPUTE_IP ?=192.168.122.100
DATAPLANE_COMPUTE_1_IP ?=192.168.122.101
DATAPLANE_RUNNER_IMG ?=quay.io/openstack-k8s-operators/openstack-ansibleee-runner:latest
DATAPLANE_NETWORK_CONFIG_TEMPLATE ?=templates/single_nic_vlans/single_nic_vlans.j2
DATAPLANE_SSHD_ALLOWED_RANGES ?=['192.168.122.0/24']
DATAPLANE_CHRONY_NTP_SERVER ?=pool.ntp.org
DATAPLANE_OVN_METADATA_AGENT_BIND_HOST ?=127.0.0.1
DATAPLANE_SINGLE_NODE ?=true
# Manila
MANILA_IMG ?= quay.io/openstack-k8s-operators/manila-operator-index:latest
MANILA_REPO ?= https://github.com/openstack-k8s-operators/manila-operator.git
MANILA_BRANCH ?= main
MANILA ?= config/samples/manila_v1beta1_manila.yaml
MANILA_CR ?= ${OPERATOR_BASE_DIR}/manila-operator/${MANILA}
# TODO: Image customizations for all Manila services
# Ceph
CEPH_IMG ?= quay.io/ceph/demo:latest
# NNCP
NNCP_INTERFACE ?= enp6s0
# Telemetry
TELEMETRY_IMG ?= quay.io/openstack-k8s-operators/telemetry-operator-index:latest
TELEMETRY_REPO ?= https://github.com/openstack-k8s-operators/telemetry-operator.git
TELEMETRY_BRANCH ?= main
TELEMETRY ?= config/samples/telemetry_v1beta1_telemetry.yaml
TELEMETRY_CR ?= ${OPERATOR_BASE_DIR}/telemetry-operator/${TELEMETRY}
CEILOMETER_CENTRAL_DEPL_IMG ?= unused
CEILOMETER_NOTIFICATION_DEPL_IMG ?= unused
SG_CORE_DEPL_IMG ?= unused
# 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: heat_cleanup horizon_cleanup nova_cleanup octavia_cleanup neutron_cleanup ovn_cleanup ironic_cleanup cinder_cleanup glance_cleanup placement_cleanup keystone_cleanup mariadb_cleanup telemetry_cleanup ## Delete all operators
.PHONY: deploy_cleanup
deploy_cleanup: heat_deploy_cleanup horizon_deploy_cleanup nova_deploy_cleanup octavia_deploy_cleanup neutron_deploy_cleanup ovn_deploy_cleanup ironic_deploy_cleanup cinder_deploy_cleanup glance_deploy_cleanup placement_deploy_cleanup keystone_deploy_cleanup mariadb_deploy_cleanup telemetry_deploy_cleanup ## Delete all OpenStack service objects
.PHONY: wait
wait: ## wait for an operator's controller-manager pod to be ready (requires OPERATOR_NAME to be explicitly passed!)
$(eval $(call vars,$@,$(value OPERATOR_NAME)))
bash scripts/operator-wait.sh
##@ CRC
.PHONY: crc_storage
crc_storage: ## initialize local storage PVs in CRC vm
$(eval $(call vars,$@))
bash scripts/create-pv.sh
bash scripts/gen-crc-pv-kustomize.sh
oc apply -f ${OUT}/crc/storage.yaml
.PHONY: crc_storage_cleanup
crc_storage_cleanup: ## cleanup local storage PVs in CRC vm
$(eval $(call vars,$@))
oc get pv | grep ${STORAGE_CLASS} | cut -f 1 -d ' ' | xargs oc delete pv
oc delete sc ${STORAGE_CLASS}
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
ifeq ($(MICROSHIFT) ,0)
oc project ${NAMESPACE}
else
oc config set-context --current --namespace=${NAMESPACE}
oc adm policy add-scc-to-user privileged -z default --namespace ${NAMESPACE}
endif
.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: namespace ## creates required secret/CM, used by the services as input
$(eval $(call vars,$@))
bash scripts/gen-input-kustomize.sh ${NAMESPACE} ${SECRET} ${PASSWORD} ${METADATA_SHARED_SECRET}
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: $(if $(findstring true,$(NETWORK_ISOLATION)), nmstate nncp netattach metallb metallb_config) ## 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}
oc delete subscription openstack-storage-operators-alpha-openstack-operator-index-openstack --ignore-not-found=true
oc delete csv openstack-storage-operators.v0.0.1 --ignore-not-found=true
.PHONY: openstack_deploy_prep
openstack_deploy_prep: export KIND=OpenStackControlPlane
openstack_deploy_prep: export IMAGE=unused
openstack_deploy_prep: openstack_deploy_cleanup $(if $(findstring true,$(NETWORK_ISOLATION)), nmstate nncp netattach metallb metallb_config) ## 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))
bash scripts/operator-deploy-resources.sh
.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}
.PHONY: edpm_deploy_prep
edpm_deploy_prep: export KIND=OpenStackDataPlane
edpm_deploy_prep: export EDPM_ANSIBLE_SECRET=${DATAPLANE_ANSIBLE_SECRET}
edpm_deploy_prep: export EDPM_SINGLE_NODE=${DATAPLANE_SINGLE_NODE}
edpm_deploy_prep: export EDPM_COMPUTE_IP=${DATAPLANE_COMPUTE_IP}
edpm_deploy_prep: export EDPM_COMPUTE_1_IP=${DATAPLANE_COMPUTE_1_IP}
edpm_deploy_prep: export OPENSTACK_RUNNER_IMG=${DATAPLANE_RUNNER_IMG}
edpm_deploy_prep: export EDPM_NETWORK_CONFIG_TEMPLATE=${DATAPLANE_NETWORK_CONFIG_TEMPLATE}
edpm_deploy_prep: export EDPM_SSHD_ALLOWED_RANGES=${DATAPLANE_SSHD_ALLOWED_RANGES}
edpm_deploy_prep: export EDPM_CHRONY_NTP_SERVER=${DATAPLANE_CHRONY_NTP_SERVER}
edpm_deploy_prep: export EDPM_OVN_METADATA_AGENT_NOVA_METADATA_HOST=$(shell oc get svc nova-metadata-internal -o json |jq -r '.status.loadBalancer.ingress[0].ip')
edpm_deploy_prep: export EDPM_OVN_METADATA_AGENT_PROXY_SHARED_SECRET=${METADATA_SHARED_SECRET}
edpm_deploy_prep: export EDPM_OVN_METADATA_AGENT_BIND_HOST=${DATAPLANE_OVN_METADATA_AGENT_BIND_HOST}
edpm_deploy_prep: export EDPM_OVN_METADATA_AGENT_TRANSPORT_URL=$(shell oc get secret rabbitmq-transport-url-neutron-neutron-transport -o json | jq -r .data.transport_url | base64 -d)
edpm_deploy_prep: export EDPM_OVN_METADATA_AGENT_SB_CONNECTION=$(shell oc get ovndbcluster ovndbcluster-sb -o json | jq -r .status.dbAddress)
edpm_deploy_prep: export EDPM_OVN_DBS=$(shell oc get ovndbcluster ovndbcluster-sb -o json | jq -r '.status.networkAttachments."openstack/internalapi"[0]')
edpm_deploy_prep: export EDPM_NADS=$(shell oc get network-attachment-definitions -o json | jq -r "[.items[].metadata.name]")
edpm_deploy_prep: edpm_deploy_cleanup $(if $(findstring true,$(NETWORK_ISOLATION)), nmstate nncp netattach metallb metallb_config) ## prepares the CR to install the data plane
$(eval $(call vars,$@,dataplane))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${DATAPLANE_BRANCH} ${DATAPLANE_REPO} && popd
cp ${DATAPLANE_CR} ${DEPLOY_DIR}
bash scripts/gen-edpm-kustomize.sh
devsetup/scripts/gen-ansibleee-ssh-key.sh
.PHONY: edpm_deploy_cleanup
edpm_deploy_cleanup: ## cleans up the edpm instance, Does not affect the operator.
$(eval $(call vars,$@,dataplane))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/dataplane-operator ${DEPLOY_DIR}
.PHONY: edpm_deploy
edpm_deploy: input edpm_deploy_prep ## installs the dataplane instance using kustomize. Runs prep step in advance. Set DATAPLANE_REPO and DATAPLANE_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,dataplane))
oc kustomize ${DEPLOY_DIR} | oc apply -f -
.PHONY: openstack_crds
openstack_crds: ## installs all openstack CRDs. Useful for infrastructure dev
mkdir -p ${OUT}/openstack_crds
skopeo copy "docker://${OPENSTACK_BUNDLE_IMG}" dir:${OUT}/openstack_crds
for X in $$(file ${OUT}/openstack_crds/* | grep gzip | cut -f 1 -d ':'); do tar xvf $$X -C ${OUT}/openstack_crds/; done
for X in $$(grep -l CustomResourceDefinition ${OUT}/openstack_crds/manifests/*); do oc apply -f $$X; done
##@ INFRA
.PHONY: infra_prep
infra_prep: export IMAGE=${INFRA_IMG}
infra_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,infra))
bash scripts/gen-olm.sh
.PHONY: infra
infra: namespace infra_prep ## installs the operator, also runs the prep step. Set INFRA_IMG for custom image.
$(eval $(call vars,$@,infra))
oc apply -f ${OPERATOR_DIR}
.PHONY: infra_cleanup
infra_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,infra))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
##@ MEMCACHED
.PHONY: memcached_deploy_prep
memcached_deploy_prep: export KIND=Memcached
memcached_deploy_prep: export IMAGE=${MEMCACHED_DEPL_IMG}
memcached_deploy_prep: memcached_deploy_cleanup ## prepares the CR to install the service based on the service sample file MEMCACHED
$(eval $(call vars,$@,infra))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${INFRA_BRANCH} ${INFRA_REPO} && popd
cp ${MEMCACHED_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: memcached_deploy
memcached_deploy: input memcached_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set INFRA_REPO and INFRA_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,infra))
bash scripts/operator-deploy-resources.sh
.PHONY: memcached_deploy_cleanup
memcached_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,infra))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/infra-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_DEPL_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))
bash scripts/operator-deploy-resources.sh
.PHONY: keystone_deploy_validate
keystone_deploy_validate: input namespace ## checks that keystone was properly deployed. Set KEYSTONE_KUTTL_DIR to use assert file from custom repo.
kubectl-kuttl assert -n ${NAMESPACE} ${KEYSTONE_KUTTL_DIR}/../common/assert_sample_deployment.yaml --timeout 180
.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))
bash scripts/operator-deploy-resources.sh
.PHONY: mariadb_deploy_validate
mariadb_deploy_validate: input namespace ## checks that mariadb was properly deployed. Set KEYSTONE_KUTTL_DIR to use assert file from custom repo.
kubectl-kuttl assert -n ${NAMESPACE} ${MARIADB_KUTTL_DIR}/../common/assert_sample_deployment.yaml --timeout 180
.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_DEPL_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))
bash scripts/operator-deploy-resources.sh
.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_DEPL_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))
bash scripts/operator-deploy-resources.sh
.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
##@ OVN
.PHONY: ovn_prep
ovn_prep: export IMAGE=${OVN_IMG}
ovn_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,ovn))
bash scripts/gen-olm.sh
.PHONY: ovn
ovn: namespace ovn_prep ## installs the operator, also runs the prep step. Set OVN_IMG for custom image.
$(eval $(call vars,$@,ovn))
oc apply -f ${OPERATOR_DIR}
.PHONY: ovn_cleanup
ovn_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,ovn))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: ovn_deploy_prep
ovn_deploy_prep: export KIND=.*
ovn_deploy_prep: export IMAGE=unused
ovn_deploy_prep: ovn_deploy_cleanup ## prepares the CR to install the service based on the service sample file OVNAPI
$(eval $(call vars,$@,ovn))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${OVN_BRANCH} ${OVN_REPO} && popd
cp ${OVNDBS_CR} ${OVNNORTHD_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: ovn_deploy
ovn_deploy: ovn_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set OVN_REPO and OVN_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,ovn))
bash scripts/operator-deploy-resources.sh
.PHONY: ovn_deploy_cleanup
ovn_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,ovn))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/ovn-operator ${DEPLOY_DIR}
##@ OVS
.PHONY: ovs_prep
ovs_prep: export IMAGE=${OVS_IMG}
ovs_prep: ## creates the files to install the operator using olm
$(eval $(call vars,$@,ovs))
bash scripts/gen-olm.sh
.PHONY: ovs
ovs: namespace ovs_prep ## installs the operator, also runs the prep step. Set OVS_IMG for custom image.
$(eval $(call vars,$@,ovs))
oc apply -f ${OPERATOR_DIR}
.PHONY: ovs_cleanup
ovs_cleanup: ## deletes the operator, but does not cleanup the service resources
$(eval $(call vars,$@,ovs))
bash scripts/operator-cleanup.sh
rm -Rf ${OPERATOR_DIR}
.PHONY: ovs_deploy_prep
ovs_deploy_prep: export KIND=.*
ovs_deploy_prep: export IMAGE=unused
ovs_deploy_prep: ovs_deploy_cleanup ## prepares the CR to install the service based on the service sample file OVS
$(eval $(call vars,$@,ovs))
mkdir -p ${OPERATOR_BASE_DIR} ${OPERATOR_DIR} ${DEPLOY_DIR}
pushd ${OPERATOR_BASE_DIR} && git clone -b ${OVS_BRANCH} ${OVS_REPO} && popd
cp ${OVS_CR} ${DEPLOY_DIR}
bash scripts/gen-service-kustomize.sh
.PHONY: ovs_deploy
ovs_deploy: ovs_deploy_prep ## installs the service instance using kustomize. Runs prep step in advance. Set OVS_REPO and OVS_BRANCH to deploy from a custom repo.
$(eval $(call vars,$@,ovs))
bash scripts/operator-deploy-resources.sh
.PHONY: ovs_deploy_cleanup
ovs_deploy_cleanup: ## cleans up the service instance, Does not affect the operator.
$(eval $(call vars,$@,ovs))
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
rm -Rf ${OPERATOR_BASE_DIR}/ovs-operator ${DEPLOY_DIR}
##@ 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_DEPL_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))
bash scripts/operator-deploy-resources.sh
.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))
bash scripts/operator-deploy-resources.sh
.PHONY: cinder_deploy_validate
cinder_deploy_validate: input namespace ## checks that cinder was properly deployed. Set CINDER_KUTTL_DIR to use assert file from custom repo.
kubectl-kuttl assert -n ${NAMESPACE} ${CINDER_KUTTL_DIR}/../common/assert_sample_deployment.yaml --timeout 180
.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))
KIND=RabbitmqCluster NAME=rabbitmq bash scripts/gen-name-kustomize.sh
bash scripts/operator-deploy-resources.sh
.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 rabbitmq
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))
bash scripts/operator-deploy-resources.sh
.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
oc rsh -t mariadb-openstack mysql -u root --password=${PASSWORD} -e "drop database ironic_inspector;" || 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=Octavia
octavia_deploy_prep: export IMAGE=unused
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 ${OCTAVIA_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))
bash scripts/operator-deploy-resources.sh
.PHONY: octavia_deploy_validate
octavia_deploy_validate: input namespace ## checks that octavia was properly deployed. Set OCTAVIA_KUTTL_DIR to use assert file from custom repo.
kubectl-kuttl assert -n ${NAMESPACE} ${OCTAVIA_KUTTL_DIR}/../common/assert_sample_deployment.yaml --timeout 180
.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))
bash scripts/operator-deploy-resources.sh
.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 {};"
##@ KUTTL tests
.PHONY: mariadb_kuttl_run
mariadb_kuttl_run: ## runs kuttl tests for the mariadb operator, assumes that everything needed for running the test was deployed beforehand.
INSTALL_YAMLS=${INSTALL_YAMLS} kubectl-kuttl test --config ${MARIADB_KUTTL_CONF} ${MARIADB_KUTTL_DIR}
.PHONY: mariadb_kuttl
mariadb_kuttl: namespace input openstack_crds deploy_cleanup mariadb_deploy_prep mariadb ## runs kuttl tests for the mariadb operator. Installs openstack crds and keystone operators and cleans up previous deployments before running the tests and, add cleanup after running the tests.
make mariadb_kuttl_run
make deploy_cleanup
make mariadb_cleanup
.PHONY: keystone_kuttl_run
keystone_kuttl_run: ## runs kuttl tests for the keystone operator, assumes that everything needed for running the test was deployed beforehand.
INSTALL_YAMLS=${INSTALL_YAMLS} KEYSTONE_KUTTL_DIR=${KEYSTONE_KUTTL_DIR} kubectl-kuttl test --config ${KEYSTONE_KUTTL_CONF} ${KEYSTONE_KUTTL_DIR}
.PHONY: keystone_kuttl
keystone_kuttl: namespace input openstack_crds deploy_cleanup mariadb mariadb_deploy mariadb_deploy_validate keystone_deploy_prep keystone ## runs kuttl tests for the keystone operator. Installs openstack crds and keystone operators and cleans up previous deployments before running the tests and, add cleanup after running the tests.
make keystone_kuttl_run
make deploy_cleanup
make keystone_cleanup
make mariadb_cleanup
.PHONY: cinder_kuttl_run
cinder_kuttl_run: ## runs kuttl tests for the cinder operator, assumes that everything needed for running the test was deployed beforehand.
INSTALL_YAMLS=${INSTALL_YAMLS} kubectl-kuttl test --config ${CINDER_KUTTL_CONF} ${CINDER_KUTTL_DIR}
.PHONY: cinder_kuttl
cinder_kuttl: namespace input openstack_crds deploy_cleanup mariadb mariadb_deploy rabbitmq rabbitmq_deploy keystone_deploy_prep keystone keystone_deploy cinder_deploy_prep cinder infra mariadb_deploy_validate ## runs kuttl tests for the cinder operator. Installs openstack crds and cinder operators and cleans up previous deployments before running the tests and, add cleanup after running the tests.
make cinder_kuttl_run
make infra_cleanup
make rabbitmq_deploy_cleanup
make rabbitmq_cleanup
make deploy_cleanup
make cinder_cleanup
make keystone_cleanup
make mariadb_cleanup
.PHONY: neutron_kuttl_run
neutron_kuttl_run: ## runs kuttl tests for the neutron operator, assumes that everything needed for running the test was deployed beforehand.
INSTALL_YAMLS=${INSTALL_YAMLS} kubectl-kuttl test --config ${NEUTRON_KUTTL_CONF} ${NEUTRON_KUTTL_DIR}
.PHONY: neutron_kuttl
neutron_kuttl: namespace input openstack_crds deploy_cleanup mariadb neutron_deploy_prep neutron mariadb_deploy keystone rabbitmq keystone_deploy ovn rabbitmq_deploy infra ovn_deploy mariadb_deploy_validate ## runs kuttl tests for the neutron operator. Installs openstack crds and mariadb, keystone, rabbitmq, ovn, infra and neutron operators and cleans up previous deployments before running the tests and, add cleanup after running the tests.
make neutron_kuttl_run
make rabbitmq_deploy_cleanup
make ovn_deploy_cleanup
make deploy_cleanup
make neutron_cleanup
make ovn_cleanup
make infra_cleanup
make rabbitmq_cleanup
make keystone_cleanup
make mariadb_cleanup