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

Custom options required within controlplane.up #19

Open
jason-bent opened this issue Oct 8, 2024 · 0 comments
Open

Custom options required within controlplane.up #19

jason-bent opened this issue Oct 8, 2024 · 0 comments

Comments

@jason-bent
Copy link

The following should be considered as options within controlplane.up
There are certain local testing conditions that require a custom kind ( Such as extraMounts or images etc...) to be used.
This also includes using ca-bundle-config for self-signed certs as documented here and used on helm install.

  • Create kind cluster with custom configuration yaml
  • Create Zscaler/others configmap ca-bundle-config
  • Set registryCaBundleConfig.name on helm install

TEMP WORKAROUND
Example

controlplane.wsl.up: $(HELM) $(KUBECTL) $(KIND)
	@$(INFO) running custom controlplane.wsl.up
	@$(INFO) setting up controlplane
        # Create kind cluster with custom configuration
	@$(KIND) get kubeconfig --name $(KIND_CLUSTER_NAME) >/dev/null 2>&1 || $(KIND) create cluster --name=$(KIND_CLUSTER_NAME) --config setup/lab/custom-kind.yaml
	@$(INFO) "setting kubectl context to kind-$(KIND_CLUSTER_NAME)"
	@$(KUBECTL) config use-context "kind-$(KIND_CLUSTER_NAME)"
	@$(HELM) repo add crossplane-build-module $(CROSSPLANE_CHART_REPO) --force-update
	@$(HELM) repo update
        # Create Zscaler configmap ca-bundle-config
	@$(KUBECTL) create namespace $(CROSSPLANE_NAMESPACE)
	@$(KUBECTL) create cm ca-bundle-config -n $(CROSSPLANE_NAMESPACE) --from-file=ca-bundle=setup/lab/zscaler.com/ZscalerRootCertificate-2048-SHA256.crt
ifndef CROSSPLANE_ARGS
	@$(INFO) setting up crossplane core without args
	@$(HELM) get notes -n $(CROSSPLANE_NAMESPACE) crossplane >/dev/null 2>&1 || $(HELM) install crossplane --create-namespace --namespace=$(CROSSPLANE_NAMESPACE) crossplane-build-module/$(CROSSPLANE_CHART_NAME) --version $(CROSSPLANE_VERSION)
else
	@$(INFO) setting up crossplane core with args $(CROSSPLANE_ARGS)
        # Set registryCaBundleConfig.name on helm install
        # registryCaBundleConfig.name=ca-bundle-config,registryCaBundleConfig.key=ca-bundle
	@$(HELM) get notes -n $(CROSSPLANE_NAMESPACE) crossplane >/dev/null 2>&1 || $(HELM) install crossplane --namespace=$(CROSSPLANE_NAMESPACE) --set "args={${CROSSPLANE_ARGS}}" --set registryCaBundleConfig.name=ca-bundle-config,registryCaBundleConfig.key=ca-bundle crossplane-build-module/$(CROSSPLANE_CHART_NAME) --version $(CROSSPLANE_VERSION)
endif

controlplane.up: $(HELM) $(KUBECTL) $(KIND)
@$(INFO) setting up controlplane
@$(KIND) get kubeconfig --name $(KIND_CLUSTER_NAME) >/dev/null 2>&1 || $(KIND) create cluster --name=$(KIND_CLUSTER_NAME)
@$(INFO) "setting kubectl context to kind-$(KIND_CLUSTER_NAME)"
@$(KUBECTL) config use-context "kind-$(KIND_CLUSTER_NAME)"
@$(HELM) repo add crossplane-build-module $(CROSSPLANE_CHART_REPO) --force-update
@$(HELM) repo update
ifndef CROSSPLANE_ARGS
@$(INFO) setting up crossplane core without args
@$(HELM) get notes -n $(CROSSPLANE_NAMESPACE) crossplane >/dev/null 2>&1 || $(HELM) install crossplane --create-namespace --namespace=$(CROSSPLANE_NAMESPACE) crossplane-build-module/$(CROSSPLANE_CHART_NAME) --version $(CROSSPLANE_VERSION)
else
@$(INFO) setting up crossplane core with args $(CROSSPLANE_ARGS)
@$(HELM) get notes -n $(CROSSPLANE_NAMESPACE) crossplane >/dev/null 2>&1 || $(HELM) install crossplane --create-namespace --namespace=$(CROSSPLANE_NAMESPACE) --set "args={${CROSSPLANE_ARGS}}" crossplane-build-module/$(CROSSPLANE_CHART_NAME) --version $(CROSSPLANE_VERSION)
endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant