Creating a Workload Cluster
In this section we will create a Workload cluster.
This workload cluster will be deployed from the Mangement cluster that we created in the previous section.
stateDiagram
direction LR
CreateWorkloadCluster --> TestScalingEvents
state CreateWorkloadCluster {
direction LR
Success? --> GetKubeConfig
}
-
Make sure your Kubernetes context is that of the your Management cluster.
-
Reserve a new Control Plane endpoint IP for your Kubernetes cluster.
-
Generate your kubernetes clusters configuration file
-
Create a namespace in the management cluster where the workload cluster can be managed
-
Apply the
cluster.yamlmanifest to create your workload cluster in the Nutanix infrastructure# Output configmap/user-ca-bundle created configmap/nutanix-ccm created secret/mycluster created secret/nutanix-ccm-secret created clusterresourceset.addons.cluster.x-k8s.io/nutanix-ccm-crs created kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/mycluster-kcfg-0 created cluster.cluster.x-k8s.io/mycluster created machinedeployment.cluster.x-k8s.io/mycluster-wmd created machinehealthcheck.cluster.x-k8s.io/mycluster-mhc created kubeadmcontrolplane.controlplane.cluster.x-k8s.io/mycluster-kcp created nutanixcluster.infrastructure.cluster.x-k8s.io/mycluster created nutanixmachinetemplate.infrastructure.cluster.x-k8s.io/mycluster-mt-0 created -
You can observe the creation of the VMs in the Prism Central/Element
-
Download the kubeconfig for workload cluster by running the following command
-
Watch the nodes in the cluster until all the nodes come up (1 control plane and 3 workers unless you modified the
clusterctl.yamlfile) -
Once the desired number of nodes are present, you will see that these will be in a
NotReadystate.k --kubeconfig mycluster.cfg get nodes NAME STATUS ROLES AGE VERSION mycluster-kcp-jnhf5 NotReady control-plane 4m43s v1.24.11 mycluster-kcp-p56j9 NotReady control-plane 6m19s v1.24.11 mycluster-kcp-z8pqj NotReady control-plane 2m13s v1.24.11 mycluster-wmd-57fcdf9f7xbgz8z-nkf45 NotReady <none> 5m27s v1.24.11 mycluster-wmd-57fcdf9f7xbgz8z-pq47m NotReady <none> 5m21s v1.24.11 mycluster-wmd-57fcdf9f7xbgz8z-pqp8s NotReady <none> 5m23s v1.24.11For the nodes to become ready you need to install CNI. You must deploy a Container Network Interface (CNI) based pod network add-on so that your pods can communicate with each other. Cluster DNS (CoreDNS) will not start up before a network is installed.
-
Run the following command to install Calico CNI.
-
Upon successful install of CNI, the nodes will get to a
READYstate. (it might take a minute or two depending on the resources available to your VMs) -
Confirm the state of your workload Kubernetes cluster
-
If you have any issues or wanting to delete any workload cluster you can use the following commands
To delete a workload cluster