Skip to content

Latest commit

 

History

History
141 lines (91 loc) · 3.07 KB

developer_workflow.md

File metadata and controls

141 lines (91 loc) · 3.07 KB

Developer workflow

This document outlines how to

Build the source code

  1. Download source code:

    git clone https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix.git
    cd cluster-api-provider-nutanix
  2. Build a container image with the source code:

    make docker-build

Create a local management cluster

  1. Create a KIND cluster:

     make kind-create

This will configure kubectl for the local cluster.

Build a CAPI Image for Nutanix

  1. 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

  1. Make a copy of the clusterctl configuration file:

    cp -n clusterctl.yaml.tmpl clusterctl.yaml
  2. Update ./clusterctl.yaml with appropriate configuration.

  3. Setup clusterctl with the configuration:

    make prepare-local-clusterctl

Deploy cluster-api-provider-nutanix provider and CRDs on local management cluster

  1. Deploy the provider, along with CAPI core controllers and CRDs:

    make deploy
  2. Verify the provider Pod is READY:

    kubectl get pods -n capx-system

Create a test workload cluster

  1. Create a workload cluster:

    make test-clusterctl-create

    Optionally, to use a unique cluster name:

    make test-clusterctl-create TEST_CLUSTER_NAME=<>
  2. 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=<>

Debugging failures

  1. Check the cluster resources:

    kubectl get cluster-api --namespace capx-test-ns
  2. Check the provider logs:

    kubectl logs -n capx-system -l cluster.x-k8s.io/provider=infrastructure-nutanix
  3. 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

  1. Delete the test workload cluster:

    make test-clusterctl-delete

    When using a unique cluster name set TEST_CLUSTER_NAME variable:

    make test-clusterctl-delete TEST_CLUSTER_NAME=<>
    
  2. Delete the management KIND cluster:

    make kind-delete