Skip to content

Latest commit

 

History

History

02_NKE_installation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Difficulty: 1/5

Summary:

This exercise will teach you how to create a Kubernetes cluster with NKE.

Prerequisites

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

Exercise

  1. Go on NKE page in Prism

    Answer
    1. Connect on Prism with you account
    2. In the main menu, select Kubernetes Management >
      Image 1

  2. Look at the image list, and download the last 2 versions (if possible)

    Answer
    1. In the left menu, select OS images
    2. In the main window, you should see a list of image available
    3. Use the download button of images you want to download
    4. Wait for end of image(s) download

  3. 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
    1. In left Menu, click on clusters

    2. In the main window, click on Create Kubernetes Workload

    3. Select your cluster type (Probably Production)

    4. Click on Next

    5. Fill the form with the good inputs
      Image 2

    6. Click on Next blue button

    7. Fill the next form with the good inputs
      Image 3

    8. Click on Next blue button

    9. Select the CNI

    10. You can let the default IP range
      Image 4

    11. Click on next

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


      Image 5

    13. Finish by clicking on Create blue button

    14. Wait for end of cluster creation
      Image 6

    15. Congrats, you have deployed your 1st kubernetes cluster


  4. Get kubeconfig file from NKE GUI

    Answer
    1. In NKE GUI, click on the name of your cluster
    2. Click on the Download kubeconfig button
      Image 7
    3. Put the file where you want on your laptop


    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.


  5. Change your $KUBECONFIG variable to target this file

    Answer
    1. Execute command export KUBECONFIG=<path to the downloaded file>

  6. 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 command kubectl 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


Takeover

  • 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