Developer workflow
June 30, 2026 ยท View on GitHub
Prerequisites
This project requires the following to be installed on the developer's workstation.
To install the required packages, please follow the directions provided for your system.
NOTE: The first time you cd into the directory, the required dependencies for the project will start to download and will take some time depending on your connection.
-
Download source code:
gh repo clone nutanix-cloud-native/cluster-api-provider-nutanix cd cluster-api-provider-nutanix -
Build a container image with the source code:
make docker-build
Create a local management cluster
-
Create a KIND cluster:
make kind-create
This will configure kubectl for the local cluster.
Build a CAPI Image for Nutanix
- Follow the instructions here to build a CAPI image for Nutanix. The image name printed at the end of the build will be needed to create a Kubernetes cluster.
Prepare local clusterctl
-
Setup
clusterctlwith the configuration to ensure local clusterctl uses the development version of the provider:make prepare-local-clusterctl
Deploy cluster-api-provider-nutanix provider and CRDs on local management cluster
-
Deploy the provider, along with CAPI core controllers and CRDs:
make deploy -
Verify the provider Pod is
READY:kubectl get pods -n capx-system
Create a regular test workload cluster (i.e. without clusterclass topology)
-
Set the required environment variables:
export EXP_CLUSTER_RESOURCE_SET=true export EXP_CLUSTER_TOPOLOGY=true export DOCKER_POD_IPV6_CIDRS="fc00::/112" export WORKER_MACHINE_COUNT="2" export CONTROL_PLANE_ENDPOINT_IP='10.0.0.1' export NUTANIX_STORAGE_CONTAINER=storage-container export NUTANIX_ADDITIONAL_CATEGORY_KEY="AppType" export NUTANIX_ADDITIONAL_CATEGORY_VALUE="Kubernetes" export NUTANIX_PROJECT_NAME="test-project" export NUTANIX_PRISM_ELEMENT_CLUSTER_NAME='prism-element-name' export NUTANIX_SUBNET_NAME="subnet-name" export LOCAL_IMAGE_REGISTRY="your.registry.uri" export NUTANIX_ENDPOINT='pc.nutanix.com' export NUTANIX_USER='username' export NUTANIX_PASSWORD='password' # Optional: set API key instead of username/password. # export NUTANIX_API_KEY='your-api-key' export NUTANIX_INSECURE='false' export NUTANIX_PORT='9440' export KUBERNETES_VERSION="v1.33.0" export NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME="image-name-on-prism-central" export NUTANIX_SSH_AUTHORIZED_KEY='your-ssh-key' -
Create a workload cluster:
make test-cluster-createOptionally, to use a different cluster name:
make test-cluster-create TEST_CLUSTER_NAME=<> -
(Optional) Get the workload cluster kubeconfig. This will write out the kubeconfig file in the local directory as
<cluster-name>.workload.kubeconfig:make generate-cluster-kubeconfigWhen using a different cluster name set
TEST_CLUSTER_NAMEvariable:make generate-cluster-kubeconfig TEST_CLUSTER_NAME=<> -
Install a CNI on the workload cluster:
make test-cluster-install-cniWhen using a different cluster name set
TEST_CLUSTER_NAMEvariable:make test-cluster-install-cni TEST_CLUSTER_NAME=<>
Create a test workload cluster with topology
-
Create a workload cluster:
make test-cc-cluster-createOptionally, to use a different cluster name:
make test-cc-cluster-create TEST_TOPOLOGY_CLUSTER_NAME=<>
Upgrade test workload cluster's k8s version
-
Upgrade workload cluster's k8s version
make test-cc-cluster-upgrade TEST_TOPOLOGY_CLUSTER_NAME=<> UPGRADE_K8S_VERSION_TO=<vx.x.x>
Debugging failures
-
Check the cluster resources:
kubectl get cluster-api --namespace capx-test-ns -
Check the provider logs:
kubectl logs -n capx-system -l cluster.x-k8s.io/provider=infrastructure-nutanix -
Check status of individual Nodes by using the address from the corresponding
NutanixMachine:ssh capiuser@<address>-
Check cloud-init bootstrap logs:
tail /var/log/cloud-init-output.log -
Check journalctl logs for Kubelet and Containerd
-
Check Containerd containers:
crictl ps -a
-
Cleanup
-
Delete the test workload cluster without topology:
make test-cluster-deleteWhen using a unique cluster name set
TEST_CLUSTER_NAMEvariable:make test-cluster-delete TEST_CLUSTER_NAME=<> -
Delete the test workload cluster with topology:
make test-cc-cluster-deleteWhen using a unique cluster name set
TEST_CLUSTER_NAMEvariable:make test-cluster-delete TEST_CLUSTER_NAME=<> -
Delete the management KIND cluster:
make kind-delete
Running E2E tests
-
Set the required environment variables
export EXP_CLUSTER_RESOURCE_SET=true export EXP_CLUSTER_TOPOLOGY=true export DOCKER_POD_IPV6_CIDRS="fc00::/112" export WORKER_MACHINE_COUNT="2" export CONTROL_PLANE_ENDPOINT_IP='10.0.0.1' export NUTANIX_STORAGE_CONTAINER=storage-container export NUTANIX_ADDITIONAL_CATEGORY_KEY="AppType" export NUTANIX_ADDITIONAL_CATEGORY_VALUE="Kubernetes" export NUTANIX_PROJECT_NAME="test-project" export NUTANIX_PRISM_ELEMENT_CLUSTER_NAME='prism-element-name' export NUTANIX_SUBNET_NAME="subnet-name" export LOCAL_IMAGE_REGISTRY="your.registry.uri" export NUTANIX_ENDPOINT='pc.nutanix.com' export NUTANIX_USER='username' export NUTANIX_PASSWORD='password' # Optional: set API key instead of username/password. # export NUTANIX_API_KEY='your-api-key' export NUTANIX_INSECURE='false' export NUTANIX_PORT='9440' export KUBERNETES_VERSION="v1.33.0" export NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME="image-name-on-prism-central" export NUTANIX_SSH_AUTHORIZED_KEY='your-ssh-key'The remaining values for the e2e tests are set in
test/e2e/config/nutanix.yaml -
Run the relevant e2e tests by specifying the label filters. For example, to run the non-clusterclass quickstart tests:
LABEL_FILTERS="quickstart && !clusterclass" make test-e2e-ciliumNote: E2E tests are run against a KIND management cluster created as part of the test run and deleted at the end of the test run.