EKS Anywhere & Octant., a simple yet a very powerful UI to visualizing EKSA clusters

Ambar Hassani
4 min readMay 11, 2022

This article is a part of the multi-part story of EKS Anywhere. Access it here EKS Anywhere, extending the Hybrid cloud momentum | by Ambar Hassani | Apr, 2022 | Medium

The debate between the ticks of a keyboard v/s the clicks of a mouse has been an everlasting one. In other words the CLI v/s GUI discussion always relays a sense that varied personas like to consume and operate technology stacks differently.

One such case., is with the standard “kubectl”, the ubiquitous command line for Kubernetes in contrast with a myriad and evolving scene of operating dashboards. In that context, Octant from VMware is a classic open-source tool-chain that helps developers, operators and admins alike view Kubernetes resources in a wonderful GUI.

Multi-cluster Kubernetes dashboard

In this article, we will deploy Octant for EKS Anywhere clusters observing some important changes to be made. Thereon, what you do with the dashboards and how you explore is to your imagination.

The below steps are outlined for a ubuntu 20.04 machine with sudo access.

Download Octant and extract the file from the github url Release v0.13.1 · vmware-tanzu/octant (github.com) and extract

tar -xvf octant_0.13.1_Linux-64bit.tar.gz

Then.,

cd octant_0.13.1_Linux-64bit
sudo cp octant /usr/local/bin/

Next we will create a Linux service based on Octant. The configuration file for the Octant service will also implement a variable called Environment=”KUBECONFIG=/home/ubuntu/.kube/config"

Note: For non-EKS Anywhere clusters

You could alter the line Environment=”KUBECONFIG=/home/ubuntu/.kube/config" to point at the desired location of the kubeconfig file.

Alternatively you can delete the line itself if you are manually setting/exporting the KUBECONFIG variable for you cluster access.

VERY IMPORANT: In the case of EKS Anywhere, the cluster creation process creates a dedicated directory per cluster that holds the individual kubeconfig files. So we will have to perform an extra step in a multi-cluster environment to merge all the kubeconfig files of the individual EKS Anywhere clusters

To do so., simply execute the below code

Assuming that you have two workload EKS-Anywhere clusters that you want to see in OctantCLUSTER1=testworkload01
CLUSTER2=testworkload02
Note how we are setting the KUBECONFIG variable to construct a semicolon separated list of of individual kubeconfig files and then using the merge and flatten arguments to create a temporary file finally leading to a properly constructed .kube/config fileKUBECONFIG=$HOME/.kube/config:$HOME/$CLUSTER1/$CLUSTER1-eks-a-cluster.kubeconfig:$HOME/$CLUSTER2/$CLUSTER2-eks-a-cluster.kubeconfig \
kubectl config view --merge --flatten > \
~/.kube/merged_kubeconfig && mv ~/.kube/merged_kubeconfig ~/.kube/config
NOTE: If you have more than 2 clusters, just create the variables, e.g. CLUSTER3=xxxx, CLUSTER4=xxxxx and then append to the KUBECONFIG command via the semicolons as you see for CLUSTER1 & CLUSTER2

and then create the Linux service for Octant by executing the below command

sudo tee /usr/lib/systemd/system/octant.service <<-'EOF'
[Unit]
Description=octant
[Service]
Environment="HOME=/home/ubuntu"
Environment="KUBECONFIG=/home/ubuntu/.kube/config"
Environment="OCTANT_LISTENER_ADDR=0.0.0.0:8900"
Environment="OCTANT_DISABLE_OPEN_BROWSER=true"
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
WorkingDirectory=/usr/local/bin/
ExecStart=/usr/local/bin/octant
Type=simple
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF

Next set the permissions and start the service

sudo chmod 755 -R /usr/lib/systemd/system/octant.service
sudo systemctl enable octant
sudo systemctl start octant
#NOTE: If you change the octant.service configuration
#Then., systemctl daemon-reload

And that’s it! You can browse the IP-address:8900 and see the dashboard in action with a superb capability of macro to micro views. The dashboard relay information about namespaces, pods, and every possible aspect of workload inspection.

From the Octant GUI, you can also switch between multiple clusters that are a part of your kubeconfig contexts.

You can also view object linkages by looking at the resource view

Beyond the views, one can also use the YAML sections to edit and update the resources

Go ahead and experiment., once deployed you will fall in love with it.

cheers

Ambar@thecloudgarage

#iwork4dell

--

--

Ambar Hassani

24+ years of blended experience of technology & people leadership, startup management and disruptive acceleration/adoption of next-gen technologies