Skip to content

Latest commit

 

History

History
182 lines (116 loc) · 4.2 KB

developer_workflow.md

File metadata and controls

182 lines (116 loc) · 4.2 KB

Developer workflow

Prerequisites

This project requires the following to be installed on the developer's workstation.

  1. devbox
  2. direnv

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.

  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 without topology

  1. Create a workload cluster:

    make test-cluster-create

    Optionally, to use a unique cluster name:

    make test-cluster-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=<>

Create a test workload cluster with topology

  1. 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 test workload cluster's k8s version

  1. Upgrade workload cluster's k8s version

    make test-cc-cluster-upgrade TEST_TOPOLOGY_CLUSTER_NAME=<> UPGRADE_K8S_VERSION_TO=<vx.x.x>

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 without topology:

    make test-cluster-delete

    When using a unique cluster name set TEST_CLUSTER_NAME variable:

    make test-cluster-delete TEST_CLUSTER_NAME=<>
    
  2. 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=<>
    
  3. Delete the management KIND cluster:

    make kind-delete