Introduction
github.com/awslabs/eks-node-viewer is an open-source tool that allows you to visualize the status of nodes in your EKS cluster directly from the command line.
Installation
This tool is developed in Go and can be installed with the following command:
go install github.com/awslabs/eks-node-viewer/cmd/eks-node-viewer@latest
Usage
You can use it simply by running:
eks-node-viewer
The --node-selector flag allows you to filter which nodes are displayed. For example, to show only nodes launched by Karpenter, run:
eks-node-viewer --node-selector "karpenter.sh/provisioner-name"
Nodes launched by Karpenter have labels like the following, so the above command specifies the label key name:
labels:
# Label with the Provisioner name as the value
karpenter.sh/provisioner-name: default
Demo
First, I ran the tool when there were no nodes launched by Karpenter in the cluster.
Next, I deployed multiple Pods to an EKS cluster with Karpenter installed to trigger node scaling. For this demo, I deployed 20 nginx Pods:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
namespace: default
spec:
replicas: 20
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx
name: nginx
resources:
requests:
memory: "1000Mi"
cpu: "1000m"
After waiting a bit, you can see nodes being launched in real-time. The tool also displays available resources on each node and the number of Pods running on them, making it easy to check the cluster's node status.
A fairly large instance type, c5a.8xlarge, was launched. Karpenter calculates the resources needed for unschedulable Pods and selects an appropriate instance type.
Next, I increased the number of Pods slightly (changed to 40). As a result, nodes started launching as shown below.
This time, you can see that a c5a.4xlarge instance type was launched. In this way, you can monitor node status in real-time while scaling Pods up and down. (Remember to delete the Deployment after testing to avoid wasting resources.)
Conclusion
I tried out github.com/awslabs/eks-node-viewer, a tool for visualizing the status of nodes in an EKS cluster. This is a useful tool for quickly checking cluster status from the command line or verifying Karpenter's behavior.
Note: Please be mindful when interacting with displayed links.
Top comments (0)