Skip to content

Creating a Management Cluster

Purpose of Management Cluster

Workstation Setup

stateDiagram
    direction LR
    CreateManagementCluster --> CreateWorkloadCluster
    state CreateManagementCluster {
      direction LR
      UseKind? --> WaitForUp
    }

We will need a Kubernetes cluster setup on our workstation. This could be any of the following:

  • Kind
  • Minikube
  • k3d

During testing on a Intel Macbook pro with 8 CPU and 16 CPU, we found out that kind cluster performed the best.

Please feel free to choose what you are familiar with and have proven sucess with.

Warning

We have noticed the following issues when we were running kubernetes clusters on local Mac/Windows

  • Pods on kube-system namespace may take about 10 minutes to download
  • Pods may take about 5 minutes to become Ready state
  • Make sure the management cluster is fully functional before proceeding to creating workload cluster

Create Management Cluster

Follow steps here to create a kind mangement cluster

Install clusterctl

Follow procedure here to install clusterctl tool

A typical linux install command would like this, but do refer the link above for the latest command and your installation platform.

Installation for AMD64 Platform
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.1/clusterctl-linux-amd64 -o clusterctl

Initialise Management Cluster

  1. Create the following file in your workstation

    vi ~/.cluster-api/clusterctl.yaml
    
  2. Fill in the following contents

    NUTANIX_ENDPOINT: ""     # IP or FQDN of Prism Central
    NUTANIX_USER: "admin"             # Prism Central user
    NUTANIX_PASSWORD: ""    # Prism Central password
    NUTANIX_INSECURE: true
    EXP_CLUSTER_RESOURCE_SET: true    # Experimental for testing CCM and Autoscaling
    EXP_MACHINE_POOL: "true"          # Experimental
    CLUSTER_TOPOLOGY: "true"          # Experimental
    
    KUBERNETES_VERSION: "v1.24.7"     # use the kubernetes version from the image build information
    WORKER_MACHINE_COUNT: 3
    NUTANIX_MACHINE_VCPU_SOCKET: 4
    NUTANIX_MACHINE_MEMORY_SIZE: "8Gi"
    NUTANIX_SSH_AUTHORIZED_KEY: "ssh-rsa AAAAB3...."
    
    NUTANIX_PRISM_ELEMENT_CLUSTER_NAME: ""
    NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME: "xxxxxx"    # use your image name from the previous section
    NUTANIX_SUBNET_NAME: "Primary"
    
  3. Instantiate the Cluster API to communicate with Nutanix Cluster

    clusterctl init -i nutanix
    
    4. Make sure all pods are in a Running and healthy state in the following namespaces:

    kubectl get pods -n capi-system
    kubectl get pods -n capx-system
    kubectl get pods -n cert-manager
    

    Warning

    If pods in the above name spaces are not running or have any errors, troubleshoot your CAPX deployment on management cluster.