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:
git clone https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix.git cd cluster-api-provider-nutanix
-
Build a container image with the source code:
make docker-build
-
Create a KIND cluster:
make kind-create
This will configure kubectl for the local cluster.
- 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.
-
Make a copy of the clusterctl configuration file:
cp -n clusterctl.yaml.tmpl clusterctl.yaml
-
Update
./clusterctl.yaml
with appropriate configuration. -
Setup
clusterctl
with the configuration:make prepare-local-clusterctl
-
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 workload cluster:
make test-cluster-create
Optionally, to use a unique cluster name:
make test-cluster-create TEST_CLUSTER_NAME=<>
-
Get the workload cluster kubeconfig. This will write out the kubeconfig file in the local directory as
<cluster-name>.workload.kubeconfig
:make test-kubectl-workload
When using a unique cluster name set
TEST_CLUSTER_NAME
variable:make test-kubectl-workload TEST_CLUSTER_NAME=<>
-
Create a workload cluster:
make test-cc-cluster-create
Optionally, to use a unique cluster name:
make test-cc-cluster-create TEST_TOPOLOGY_CLUSTER_NAME=<>
-
Upgrade workload cluster's k8s version
make test-cc-cluster-upgrade TEST_TOPOLOGY_CLUSTER_NAME=<> UPGRADE_K8S_VERSION_TO=<vx.x.x>
-
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
-
-
Delete the test workload cluster without topology:
make test-cluster-delete
When using a unique cluster name set
TEST_CLUSTER_NAME
variable:make test-cluster-delete TEST_CLUSTER_NAME=<>
-
Delete the test workload cluster with topology:
make test-cc-cluster-delete
When using a unique cluster name set
TEST_CLUSTER_NAME
variable:make test-cluster-delete TEST_CLUSTER_NAME=<>
-
Delete the management KIND cluster:
make kind-delete