Skip to content

Latest commit

 

History

History

03_Nutanix_karbon_plugin

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Difficulty: 1/5

Summary:

This exercise will teach you how to use the kubectl karbon plugin to easily get NKE Cluster kubeconfig file without having to get it from the Prism Central GUI.

Prerequisites

  • A Nutanix cluster with Prism Central with NKE activated
  • A NKE cluster deployed
  • A prism account with rights on NKE
  • kubectl installed on your laptop
  • Recommended : have brew installed on your laptop

Presentation / Context

A great plugin exists for kubectl to directly get the kubeconfig file from Prism Central to connect to your NKE cluster, without having to use the Prism Central web interface.

Exercise

  1. Install the karbon plugin from https://github.com/nutanix/kubectl-karbon

    Answer
    1. Look at the installation options on the github repo, and choose the preferred one
    2. Install the plugin. For example brew install nutanix/tap/kubectl-karbon

  2. With this plugin, get kubeconfig file from your NKE cluster

    Answer
    1. Execute command kubectl karbon login --server <Prism Central IP or FQDN> --user <your user>

      Note: you can also use

      • --insecure if your PC does not have valid certificate
      • --force if you already have an old kubeconfig file
      • --kubie to use kubeconfig file with kubie
    2. Enter your password when prompted

    3. Select your cluster name with arrows up and down

      Note: you can also enter some characters to filter cluster list

    4. Validate with 'Enter' key

    5. Your kubeconfig file is now downloaded and applied (for this session shell only)


  3. Check connection with your kubernetes cluster

    Answer
    1. Launch any kubectl command. For example : kubectl cluster-info
    2. If you get an answer, your are good !

Takeover

  • Rather than using NKE GUI to get kubeconfig file for your NKE cluster, you can use a kubectl plugin to easily get kubeconfig file.