Skip to content

Commit

Permalink
restructuring by removing env var usage in clusterclass templates (#392)
Browse files Browse the repository at this point in the history
* removed portion which is added by patches in clusterclass

this data will be passed thru variables

* added default names to reduce more env vars

* added default name to cluster with topology

* Revert "added default name to cluster with topology"

This reverts commit 584dae2.

* removed namespace env var

* make cluster-e2e-templates-no-kubeproxy

* removed more env var usage

also restructured base-root to more readable ccm folder

* removed clustername env var from providerID as not needed

* removed more env var usage from ccm yamls

separated cluster with and without topology related ccm yamls for easy
updates thru variables

* now moved ccm/cpi related objects to cluster instead of clusterclass

This is useful since ccm applies to workload cluster only.

* reverted configmapgenerator changes as crs causing issues

* ccm only has one pc-trusted-bundle so no need to have a cluster specific name

* fixed the e2e clusterclass file name

* fixed lint-yaml

* made prismCentral and controlPlaneEndpoing as required fields in api

* Revert "made prismCentral and controlPlaneEndpoing as required fields in api"

This reverts commit 8e31891.

* made prismCentral and controlPlaneEndpoing as required fields in api

* Revert "made prismCentral and controlPlaneEndpoing as required fields in api"

This reverts commit b7a035b.

* Revert makefile e2e clusterclass template name

Change it back to clusterclass-e2e.yaml

* Set default value for tls-cipher-suites in clusterclass templates

* Remove clusterclass e2e manifest

This should not have been checked-in.

* added missing file ref in e2e.

* now made all the ref to new cc name

---------

Co-authored-by: Deepak Muley <deepak.muley@nutanix.com>
  • Loading branch information
thunderboltsid and deepakm-ntnx authored Mar 21, 2024
1 parent d755db6 commit de7ccf9
Show file tree
Hide file tree
Showing 40 changed files with 766 additions and 1,265 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ testbin/*

# auto-generated e2e cluster-template yaml files
test/e2e/data/infrastructure-nutanix/*/cluster-template*.yaml
test/e2e/data/infrastructure-nutanix/*/clusterclass-*.yaml

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ run: manifests generate fmt vet ## Run a controller from your host.
.PHONY: docker-build
docker-build: ## Build docker image with the manager.
echo "Git commit hash: ${GIT_COMMIT_HASH}"
KO_DOCKER_REPO=ko.local GOFLAGS="-ldflags=-X=main.gitCommitHash=${GIT_COMMIT_HASH}" ko build -B --platform=${PLATFORMS} -t ${IMG_TAG} -L .
KO_DOCKER_REPO=ko.local GOFLAGS="-ldflags=-X=main.gitCommitHash=${GIT_COMMIT_HASH}" ko build -B --platform=${PLATFORMS} -t ${IMG_TAG} .

.PHONY: docker-push
docker-push: ## Push docker image with the manager.
KO_DOCKER_REPO=${IMG_REPO} ko build --bare --platform=${PLATFORMS} -t ${IMG_TAG} .

.PHONY: docker-push-kind
docker-push-kind: ## Make docker image available to kind cluster.
GOOS=linux GOARCH=${shell go env GOARCH} KO_DOCKER_REPO=ko.local ko build -B -t ${IMG_TAG} -L .
GOOS=linux GOARCH=${shell go env GOARCH} KO_DOCKER_REPO=ko.local ko build -B -t ${IMG_TAG} .
docker tag ko.local/cluster-api-provider-nutanix:${IMG_TAG} ${IMG}
kind load docker-image --name ${KIND_CLUSTER_NAME} ${IMG}

Expand Down Expand Up @@ -251,7 +251,7 @@ cluster-e2e-templates-v1beta1: ## Generate cluster templates for v1beta1
kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-csi --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-csi.yaml
kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-failure-domains --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-failure-domains.yaml
kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-clusterclass --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-clusterclass.yaml
kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-clusterclass --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/clusterclass-e2e.yaml
kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-clusterclass --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/clusterclass-nutanix-quick-start.yaml
kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-topology.yaml

cluster-e2e-templates-no-kubeproxy: ##Generate cluster templates without kubeproxy
Expand All @@ -272,7 +272,7 @@ cluster-e2e-templates-no-kubeproxy: ##Generate cluster templates without kubepro
kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/no-kubeproxy/cluster-template-csi --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-csi.yaml
kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/no-kubeproxy/cluster-template-failure-domains --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-failure-domains.yaml
kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/no-kubeproxy/cluster-template-clusterclass --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-clusterclass.yaml
kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/no-kubeproxy/cluster-template-clusterclass --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/clusterclass-e2e.yaml
kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/no-kubeproxy/cluster-template-clusterclass --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/clusterclass-nutanix-quick-start.yaml
kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/no-kubeproxy/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-topology.yaml

cluster-templates: ## Generate cluster templates for all flavors
Expand Down
2 changes: 1 addition & 1 deletion scripts/ccm_nutanix_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ helm template -n kube-system nutanix-cloud-provider nutanix/nutanix-cloud-provid
--set prismCentralEndPoint='${NUTANIX_ENDPOINT}',prismCentralPort='${NUTANIX_PORT=9440}',prismCentralInsecure='${NUTANIX_INSECURE=false}' \
--set image.repository="\${CCM_REPO=$NUTANIX_CCM_REPO}",image.tag="\${CCM_TAG=v$NUTANIX_CCM_VERSION}" \
--set createSecret=false \
> templates/base-root/nutanix-ccm.yaml
> templates/ccm/nutanix-ccm.yaml
File renamed without changes.
4 changes: 3 additions & 1 deletion templates/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ kind: Kustomization
namespace: "${NAMESPACE}"

bases:
- ../base-root
- ../ccm
- ./cm.yaml
- ./secret.yaml
- ./nutanix-cluster.yaml
- ./cluster-without-topology.yaml
- ./kcp.yaml
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ configMapGenerator:
- nutanix-ccm.yaml

bases:
- ./secret.yaml
- ./cm.yaml
- ./nutanix-ccm-crs.yaml
- ./nutanix-ccm-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
- kind: Secret
name: nutanix-ccm-secret
- kind: ConfigMap
name: ${CLUSTER_NAME}-pc-trusted-ca-bundle
name: nutanix-ccm-pc-trusted-ca-bundle
strategy: ApplyOnce
---
apiVersion: v1
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit de7ccf9

Please sign in to comment.