Visualizing a TKG guest cluster using VMware Octant

In my previous blog post, I provided an overview of the VMware Octant project and how it can help in visualizing a Kubernetes cluster and the benefits it can bring to the developer and IT operator community.

In this blog post, we will look at how we can visualize a newly added Tanzu Kubernetes Grid (TKG) guest cluster and the applications deployed on top of it using VMware Octant.

I will not be covering the deployment of TKG management cluster in this blog post as there are many blog posts that cover the topic at length. My favorite is the blog post by Cormac Hogan which covers the deployment of management and guest cluster in detail.

Also, you will need a VM with kubectl installed using which you will remotely connect to the created guest cluster. This can either be a windows server or a Linux server as I will be demonstrating installation of Octant on both the platforms.

Assuming that you have triggered a guest cluster creation like below and it is up and running, we will now move to the next steps of downloading and installing Octant.

$ tkg create cluster <cluster-name> --plan=dev 

Note: I used dev for simplicity, you can use dev or prod depending on your requirement.

$ tkg get cluster

Next, get the credentials to the context to point it to the newly created guest cluster.

$ tkg get credentials <cluster-name>
$ kubectl config get-contexts

Now, use the context and set it to the guest cluster and verify the kubectl is pointing to the right cluster.

$ kubectl config use-context abhilashb-admin@abhilashb
$ Kubectl get nodes

We then move on to deploying Octant. Octant can be downloaded and installed both on Windows and Linux servers. I will be covering both in this blog post.

For Windows, go to the Octant download page and download the zip file and extract it. You’ll find two files in the folder.

Run the octant.exe file as an administrator in the command line or power shell window and the Web UI should launch as below.

Notice that the UI is showing the detail of the cluster with the node details that are part of the TKG guest cluster that we just deployed.

For Linux, go to the Octant download page and download the tar.gz file and extract it. You’ll find two files in the folder.

Run the octant file and the Web UI will launch automatically.

Now, let us deploy a basic busybox pod and check if it shows up on the UI.

apiVersion: v1
kind: Pod
metadata:
  name: busybox
spec:
  containers:
  - name: busybox
    image: busybox:latest
    command:
      - sleep
      - "3600"
    imagePullPolicy: IfNotPresent
  restartPolicy: Always

The busybox shows up on the UI immediately after the pod creation is successful. This helps the developer visualize what they are deploying onto their Kubernetes clusters and also for IT operators to track and perform operations on it.

Remember that the UI will show all the users whose contexts have been loaded to the kubectl instance that is installed on the server where octant runs. If you need to limit the visibility, implement RBAC to make sure users only access their own resources. This way, they can only visualize the resources they deploy and manage them.

Hope this blog post was helpful.

Leave a Reply