Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make: rework kind-install-cilium-clustermesh for Cilium CLI Helm mode #26753

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 22 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -497,32 +497,34 @@ kind-clustermesh-images: kind-clustermesh-ready kind-build-clustermesh-apiserver
$(QUIET)kind load docker-image $(LOCAL_KVSTOREMESH_IMAGE) --name clustermesh1
$(QUIET)kind load docker-image $(LOCAL_KVSTOREMESH_IMAGE) --name clustermesh2

ENABLE_KVSTOREMESH ?= false
$(eval $(call KIND_ENV,kind-install-cilium-clustermesh))
kind-install-cilium-clustermesh: kind-clustermesh-ready ## Install a local Cilium version into the clustermesh clusters and enable clustermesh.
@echo " INSTALL cilium on clustermesh1 cluster"
kubectl config use kind-clustermesh1
-$(CILIUM_CLI) uninstall >/dev/null
$(CILIUM_CLI) install \
-$(CILIUM_CLI) --context=kind-clustermesh1 uninstall >/dev/null
$(CILIUM_CLI) --context=kind-clustermesh1 install \
--chart-directory=$(ROOT_DIR)/install/kubernetes/cilium \
--helm-values=$(ROOT_DIR)/contrib/testing/kind-clustermesh1.yaml \
--agent-image=$(LOCAL_AGENT_IMAGE) \
--operator-image=$(LOCAL_OPERATOR_IMAGE) \
--version=
--values=$(ROOT_DIR)/contrib/testing/kind-clustermesh1.yaml \
--set=image.override=$(LOCAL_AGENT_IMAGE) \
--set=operator.image.override=$(LOCAL_OPERATOR_IMAGE) \
--set=clustermesh.apiserver.image.override=$(LOCAL_CLUSTERMESH_IMAGE) \
--set=clustermesh.apiserver.kvstoremesh.image.override=$(LOCAL_KVSTOREMESH_IMAGE) \
--set=clustermesh.apiserver.kvstoremesh.enabled=$(ENABLE_KVSTOREMESH)

@echo " INSTALL cilium on clustermesh2 cluster"
kubectl config use kind-clustermesh2
-$(CILIUM_CLI) uninstall >/dev/null
$(CILIUM_CLI) install \
--inherit-ca kind-clustermesh1 \
-$(CILIUM_CLI) --context=kind-clustermesh2 uninstall >/dev/null
$(KUBECTL) --context=kind-clustermesh1 get secret -n kube-system cilium-ca -o yaml | \
$(KUBECTL) --context=kind-clustermesh2 replace --force -f -
$(CILIUM_CLI) --context=kind-clustermesh2 install \
--chart-directory=$(ROOT_DIR)/install/kubernetes/cilium \
--helm-values=$(ROOT_DIR)/contrib/testing/kind-clustermesh2.yaml \
--agent-image=$(LOCAL_AGENT_IMAGE) \
--operator-image=$(LOCAL_OPERATOR_IMAGE) \
--version=
@echo " Enabling clustermesh"
$(CILIUM_CLI) clustermesh enable --context kind-clustermesh1 --service-type NodePort --apiserver-image $(LOCAL_CLUSTERMESH_IMAGE)
$(CILIUM_CLI) clustermesh enable --context kind-clustermesh2 --service-type NodePort --apiserver-image $(LOCAL_CLUSTERMESH_IMAGE)
$(CILIUM_CLI) clustermesh status --context kind-clustermesh1 --wait
$(CILIUM_CLI) clustermesh status --context kind-clustermesh2 --wait
--values=$(ROOT_DIR)/contrib/testing/kind-clustermesh2.yaml \
--set=image.override=$(LOCAL_AGENT_IMAGE) \
--set=operator.image.override=$(LOCAL_OPERATOR_IMAGE) \
--set=clustermesh.apiserver.image.override=$(LOCAL_CLUSTERMESH_IMAGE) \
--set=clustermesh.apiserver.kvstoremesh.image.override=$(LOCAL_KVSTOREMESH_IMAGE) \
--set=clustermesh.apiserver.kvstoremesh.enabled=$(ENABLE_KVSTOREMESH)

@echo " CONNECT the two clusters"
$(CILIUM_CLI) clustermesh connect --context kind-clustermesh1 --destination-context kind-clustermesh2
$(CILIUM_CLI) clustermesh status --context kind-clustermesh1 --wait
$(CILIUM_CLI) clustermesh status --context kind-clustermesh2 --wait
Expand Down
1 change: 1 addition & 0 deletions Makefile.defs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ CONSUL_IMAGE=consul:1.7.2

export CILIUM_CLI ?= cilium
export GO ?= go
export KUBECTL ?= kubectl

# go build/test/clean flags
# these are declared here so they are treated explicitly
Expand Down
10 changes: 10 additions & 0 deletions contrib/testing/kind-clustermesh1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,13 @@ readinessProbe:
failureThreshold: 9999
startupProbe:
failureThreshold: 9999
clustermesh:
useAPIServer: true
apiserver:
image:
pullPolicy: Never
kvstoremesh:
image:
pullPolicy: Never
service:
nodePort: 32379
10 changes: 10 additions & 0 deletions contrib/testing/kind-clustermesh2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,13 @@ readinessProbe:
failureThreshold: 9999
startupProbe:
failureThreshold: 9999
clustermesh:
useAPIServer: true
apiserver:
image:
pullPolicy: Never
kvstoremesh:
image:
pullPolicy: Never
service:
nodePort: 32380