@@ -1244,17 +1244,22 @@ uninstall-crds: $(BUILD_TARGETS)/manifests ## Uninstall the CRDs
12441244.PHONY : deploy-and-wait
12451245deploy-and-wait : deploy wait-for-deploy # # Deploy the Coherence Operator and wait for the Operator Pod to be ready
12461246
1247+ OPERATOR_HA ?= false
1248+
12471249.PHONY : deploy
12481250deploy : prepare-deploy create-namespace kustomize # # Deploy the Coherence Operator
12491251ifneq (,$(WATCH_NAMESPACE ) )
12501252 cd $(BUILD_DEPLOY)/manager && $(KUSTOMIZE) edit add configmap env-vars --from-literal WATCH_NAMESPACE=$(WATCH_NAMESPACE)
1253+ endif
1254+ ifeq (true,$(OPERATOR_HA ) )
1255+ cd $(BUILD_DEPLOY)/manager && $(KUSTOMIZE) edit add patch --kind Deployment --name controller-manager --path ha-patch.yaml
12511256endif
12521257 kubectl -n $(OPERATOR_NAMESPACE) create secret generic coherence-webhook-server-cert || true
12531258 $(KUSTOMIZE) build $(BUILD_DEPLOY)/default | kubectl apply -f -
12541259 sleep 5
12551260
12561261.PHONY : just-deploy
1257- just-deploy :
1262+ just-deploy : # # Deploy the Coherence Operator without rebuilding anything
12581263 $(call prepare_deploy,$(OPERATOR_IMAGE ) ,$(OPERATOR_NAMESPACE ) ,$(UTILS_IMAGE ) )
12591264 $(KUSTOMIZE ) build $(BUILD_DEPLOY ) /default | kubectl apply -f -
12601265
@@ -1362,6 +1367,8 @@ ifeq ($(CREATE_OPERATOR_NAMESPACE),true)
13621367 kubectl get ns $(OPERATOR_NAMESPACE) -o name > /dev/null 2>&1 || kubectl create namespace $(OPERATOR_NAMESPACE)
13631368 kubectl get ns $(OPERATOR_NAMESPACE_CLIENT) -o name > /dev/null 2>&1 || kubectl create namespace $(OPERATOR_NAMESPACE_CLIENT)
13641369endif
1370+ kubectl label namespace $(OPERATOR_NAMESPACE) coherence.oracle.com/test=true --overwrite
1371+ kubectl label namespace $(OPERATOR_NAMESPACE_CLIENT) coherence.oracle.com/test=true --overwrite
13651372
13661373# ----------------------------------------------------------------------------------------------------------------------
13671374# Delete and re-create the test namespace
@@ -1452,17 +1459,37 @@ create-ssl-secrets: $(BUILD_OUTPUT)/certs
14521459# #@ KinD
14531460
14541461KIND_CLUSTER ?= operator
1455- KIND_IMAGE ?= "kindest/node:v1.21.1 @sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6 "
1462+ KIND_IMAGE ?= "kindest/node:v1.24.0 @sha256:0866296e693efe1fed79d5e6c7af8df71fc73ae45e3679af05342239cdc5bc8e "
14561463
14571464# ----------------------------------------------------------------------------------------------------------------------
14581465# Start a Kind cluster
14591466# ----------------------------------------------------------------------------------------------------------------------
14601467.PHONY : kind
14611468kind : # # Run a default KinD cluster
1469+ ./hack/kind.sh --wait 10m --image $(KIND_IMAGE )
1470+ ./hack/kind-label-node.sh
1471+
1472+ # ----------------------------------------------------------------------------------------------------------------------
1473+ # Start a Kind cluster
1474+ # ----------------------------------------------------------------------------------------------------------------------
1475+ .PHONY : kind-single-worker
1476+ kind-single-worker : export KIND_CONFIG=./hack/kind-config-single.yaml
1477+ kind-single-worker : # # Run a KinD cluster with a single worker node
1478+ ./hack/kind.sh --wait 10m --image $(KIND_IMAGE )
1479+ ./hack/kind-label-node.sh
1480+
1481+ # ----------------------------------------------------------------------------------------------------------------------
1482+ # Start a Kind cluster with Calico
1483+ # ----------------------------------------------------------------------------------------------------------------------
1484+ .PHONY : kind-calico
1485+ kind-calico : export KIND_CONFIG=./hack/kind-config-calico.yaml
1486+ kind-calico : # # Run a KinD cluster with Calico
14621487 ./hack/kind.sh --image $(KIND_IMAGE )
14631488 ./hack/kind-label-node.sh
1464- docker pull $(COHERENCE_IMAGE )
1465- kind load docker-image --name $(KIND_CLUSTER ) $(COHERENCE_IMAGE )
1489+ curl -sL https://docs.projectcalico.org/manifests/calico.yaml | kubectl apply -f -
1490+ kubectl -n kube-system set env daemonset/calico-node FELIX_IGNORELOOSERPF=true
1491+ kubectl -n kube-system wait --for condition=ready --timeout=300s -l k8s-app=calico-node pod
1492+ kubectl -n kube-system wait --for condition=ready --timeout=300s -l k8s-app=kube-dns pod
14661493
14671494# ----------------------------------------------------------------------------------------------------------------------
14681495# Stop and delete the Kind cluster
@@ -1475,7 +1502,7 @@ kind-stop: ## Stop and delete the KinD cluster named "$(KIND_CLUSTER)"
14751502# Load images into Kind
14761503# ----------------------------------------------------------------------------------------------------------------------
14771504.PHONY : kind-load
1478- kind-load : kind-load-operator # # Load all images into the KinD cluster
1505+ kind-load : kind-load-operator kind-load-coherence # # Load all images into the KinD cluster
14791506 kind load docker-image --name $(KIND_CLUSTER ) $(TEST_APPLICATION_IMAGE ) || true
14801507 kind load docker-image --name $(KIND_CLUSTER ) $(TEST_APPLICATION_IMAGE_CLIENT ) || true
14811508 kind load docker-image --name $(KIND_CLUSTER ) $(TEST_APPLICATION_IMAGE_HELIDON ) || true
@@ -1486,6 +1513,11 @@ kind-load: kind-load-operator ## Load all images into the KinD cluster
14861513 kind load docker-image --name $(KIND_CLUSTER ) docker.elastic.co/elasticsearch/elasticsearch:7.6.2 || true
14871514 kind load docker-image --name $(KIND_CLUSTER ) docker.elastic.co/kibana/kibana:7.6.2 || true
14881515
1516+ .PHONY : kind-load-coherence
1517+ kind-load-coherence : # # Load the Coherence image into the KinD cluster
1518+ docker pull $(COHERENCE_IMAGE )
1519+ kind load docker-image --name $(KIND_CLUSTER ) $(COHERENCE_IMAGE )
1520+
14891521.PHONY : kind-load-operator
14901522kind-load-operator : # # Load the Operator images into the KinD cluster
14911523 kind load docker-image --name $(KIND_CLUSTER ) $(OPERATOR_IMAGE ) || true
0 commit comments