Skip to content

Custom options required within controlplane.up #19

@jason-bent

Description

@jason-bent

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions