Difficulty: 1/5
This exercise will teach you how to create a Kubernetes cluster with NKE.
- A Nutanix cluster using AHV
- ESXi is not supported for NKE clusters
- Nutanix Kubernetes Engine needs to be activated in Prism link and up-to-date
- A Prism account authorized to deploy NKE clusters
- Network :
- Production clusters : Configure an AHV network with IP address management (IPAM) enabled and IP pools configured.
- Development clusters : Configure an AHV network with IPAM and IP address pools or with an external DHCP network.
kubectl
command must be installed on your laptop.
-
Go on NKE page in Prism
-
Look at the image list, and download the last 2 versions (if possible)
Answer
- In the left menu, select
OS images
- In the main window, you should see a list of image available
- Use the
download
button of images you want to download - Wait for end of image(s) download
- In the left menu, select
-
Deploy a cluster, with these characteristics (use default ones if they are not specified here) :
- Type : Production cluster
- Note : if you do not have choice, use development one
- name : <your initials>-cluster
- Tip : NKE supports only lower chars and dash symbol
- Nutanix cluster : choose the cluster of your choice (if you have many)
- Kubernetes version : choose the last version - 1 (it will allow us to test upgrade later)
- Host OS : choose the last version -1 (if possible, it will allow us to test upgrade later)
- Network : Choose the network of your choice
- Number of workers : 3
- Change config of worker to setup : 8 vCPU, 12 GB of RAM and 120 GB of disk
- Control plane configuration : Active-Passive
- Control plane IP address : pick a free IP
- Important : this IP must be outside the managed IP pool.
- Number of etcd nodes : 3
- CNI : Calico
- Storageclass name : nutanix-volumes
- Storage container name : pick up the container of your choice
- Reclaim policy : Delete
- File system : xfs
Answer
-
In left Menu, click on
clusters
-
In the main window, click on
Create Kubernetes Workload
-
Select your cluster type (Probably
Production
) -
Click on
Next
-
Click on
Next
blue button -
Click on
Next
blue button -
Select the CNI
-
Click on next
-
Enter information for your storage-class
- NKE deploys automatically a storage class to simply consume Nutanix block storage. This SC will be set as default class.
-
Finish by clicking on
Create
blue button -
Congrats, you have deployed your 1st kubernetes cluster
- Type : Production cluster
-
Get kubeconfig file from NKE GUI
Answer
Note : Your kubeconfig file contain a token which is valid only 24h, for security reasons. You'll have to download it again once it's expired.
-
Change your $KUBECONFIG variable to target this file
Answer
- Execute command
export KUBECONFIG=<path to the downloaded file>
- Execute command
-
Use kubectl command to get nodes list and validate K8s cluster connection
Answer
You have 2 options :
- As you have changed your
KUBECONFIG
environment variable value, you can launch commandkubectl get nodes
- You can also execute command
kubeconfig --kubeconfig <path to the downloaded file> get nodes
You should have an output similar to this one :NAME STATUS ROLES AGE VERSION gl-gautier-b4d7aa-master-0 Ready control-plane,master 22m v1.24.10 gl-gautier-b4d7aa-master-1 Ready control-plane,master 21m v1.24.10 gl-gautier-b4d7aa-worker-0 Ready node 20m v1.24.10 gl-gautier-b4d7aa-worker-1 Ready node 19m v1.24.10 gl-gautier-b4d7aa-worker-2 Ready node 19m v1.24.10
Note : etcd machines are not displayed, it is normal
- As you have changed your
- NKE is a perfect solution to deploy kubernetes clusters without any skills
- 2 options of deployment are available, production option provisions a highly available K8s cluster