๐ฅ Meet eks-node-viewer
A tiny CLI tool from AWS Labs. Built originally for Karpenter demos. Now open source. And honestly, underrated.
One command:
eks-node-viewer --resources cpu,memory
You instantly see:
- Every node in your cluster
- CPU + Memory usage (based on pod requests)
- Instance type (t3.medium, c6a.2xlarge...)
- On-Demand vs Spot
- Cost per hour AND per month
- Pods per node
Real-time. In your terminal. No dashboard hopping. No Grafana. No console tab-switching.
๐ฏ When I Use It
I use eks-node-viewer when:
- โ Debugging uneven pod scheduling across nodes
- โ Checking if Karpenter consolidation is actually working
- โ Quick cost sanity check before a prod deploy
- โ Spotting nodes that are packed too tight (or wasting capacity)
- โ Answering "why is my bill so high?" in 30 seconds
If you run multiple clusters (or even one busy prod cluster), this is a ridiculously fast way to understand what's happening.
๐ Let's Build a Demo
I'll show you exactly how to use eks-node-viewer with a real EKS cluster.
What we'll do:
- Create an EKS cluster (1 node)
- Install eks-node-viewer
- Deploy workloads
- Watch costs in real-time
- See Karpenter-style scaling (optional)
Step 1: Create EKS Cluster
First, we need an EKS cluster. I'm using eksctl because it's the fastest way.
Create Cluster Config
cat > eks-node-viewer-cluster.yaml << 'EOF'
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: eks-node-viewer-demo
region: us-east-1
version: "1.31"
managedNodeGroups:
- name: demo-nodes
instanceType: t3.medium
minSize: 1
maxSize: 1
desiredCapacity: 1
volumeSize: 20
labels:
role: demo
tags:
Environment: demo
Tool: eks-node-viewer
EOF
Create the Cluster
eksctl create cluster -f eks-node-viewer-cluster.yaml
While it's creating, let's install eks-node-viewer.
Step 2: Install eks-node-viewer
Option 1: Using Go (Recommended)
go install github.com/awslabs/eks-node-viewer/cmd/eks-node-viewer@latest
Option 2: Using Homebrew (Mac)
brew tap aws/tap
brew install eks-node-viewer
Option 3: Download Binary
# Download latest release
curl -LO https://github.com/awslabs/eks-node-viewer/releases/latest/download/eks-node-viewer_$(uname -s)_$(uname -m).tar.gz
# Extract
tar -xzf eks-node-viewer_*.tar.gz
# Move to PATH
sudo mv eks-node-viewer /usr/local/bin/
sudo chmod +x /usr/local/bin/eks-node-viewer
Verify Installation
eks-node-viewer --version
# Output: eks-node-viewer version v0.7.4
Step 3: Connect to Cluster
Once your cluster is ready, update your kubeconfig:
# List clusters
aws eks list-clusters --region us-east-1
# Update kubeconfig
aws eks update-kubeconfig --name eks-node-viewer-demo --region us-east-1
# Verify connection
kubectl get nodes
Output:
NAME STATUS ROLES AGE VERSION
ip-192-168-13-156.ec2.internal Ready <none> 2m v1.31.14-eks-70ce843
โ Cluster is ready!
Step 4: Run eks-node-viewer (Baseline)
Now for the magic. Run eks-node-viewer:
# Set AWS region (important!)
export AWS_REGION=us-east-1
# Run eks-node-viewer
eks-node-viewer --resources cpu,memory
What you'll see:
1 nodes (550m/1930m) 28.5% cpu โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ $0.042/hour | $30.368/month
540Mi/3376720Ki 16.4% memory โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
6 pods (0 pending 6 running 6 bound)
Let's break this down:
- 1 nodes - You have 1 node (t3.medium)
- 550m/1930m - Using 550 millicores out of 1930m available (28.5%)
- 540Mi/3376720Ki - Using 540MB out of 3.3GB RAM (16.4%)
- $0.042/hour | $30.368/month - This is costing you $30/month
- 6 pods - System pods (coredns, kube-proxy, aws-node, metrics-server)
๐ธ Screenshot this! This is your baseline.
Step 5: Deploy Nginx (Watch Costs Update)
Keep eks-node-viewer running in Terminal 1.
Open a NEW terminal (Terminal 2) and deploy nginx:
# Set region
export AWS_REGION=us-east-1
# Deploy nginx with 5 replicas
kubectl create deployment nginx --image=nginx --replicas=5
# Check deployment
kubectl get deployments
kubectl get pods
Output:
NAME READY UP-TO-DATE AVAILABLE AGE
nginx 5/5 5 5 30s
Switch back to Terminal 1 (eks-node-viewer).
You'll see it update in real-time:
1 nodes (750m/1930m) 38.9% cpu โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ $0.042/hour | $30.368/month
840Mi/3376720Ki 25.5% memory โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
11 pods (0 pending 11 running 11 bound)
What changed:
- CPU usage: 28.5% โ 38.9%
- Memory usage: 16.4% โ 25.5%
- Pods: 6 โ 11 (added 5 nginx pods)
- Cost: Still $30/month (same node)
๐ธ Screenshot this!
Step 6: Deploy CPU-Intensive App
Let's stress the CPU and watch it happen live:
# Deploy stress test (Terminal 2)
kubectl create deployment stress --image=polinux/stress \
--replicas=3 -- stress --cpu 1 --timeout 3600s
# Check pods
kubectl get pods | grep stress
In eks-node-viewer (Terminal 1):
1 nodes (1550m/1930m) 80.3% cpu โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ $0.042/hour | $30.368/month
1140Mi/3376720Ki 34.6% memory โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
14 pods (0 pending 14 running 14 bound)
What changed:
- CPU usage: 38.9% โ 80.3% ๐ฅ
- Memory usage: 25.5% โ 34.6%
- Pods: 11 โ 14 (added 3 stress pods)
- Cost: Still $30/month (same node, but now heavily utilized)
๐ธ Screenshot this!
This is the key insight: You can see your node is now 80% utilized. If you add more workloads, you'll need another node (and another $30/month).
Step 7: Scale Up (Watch Node Get Packed)
Let's push it further:
# Scale nginx to 20 replicas (Terminal 2)
kubectl scale deployment nginx --replicas=20
# Watch pods
kubectl get pods | grep nginx | wc -l
In eks-node-viewer:
1 nodes (1850m/1930m) 95.9% cpu โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ $0.042/hour | $30.368/month
1640Mi/3376720Ki 49.8% memory โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
29 pods (0 pending 29 running 29 bound)
What changed:
- CPU usage: 80.3% โ 95.9% ๐จ
- Memory usage: 34.6% โ 49.8%
- Pods: 14 โ 29 (added 15 more nginx pods)
- Node is almost maxed out!
๐ธ Screenshot this!
Real-world insight: If you were using Karpenter, it would see this 95% CPU usage and provision a new node. You'd see a second line appear in eks-node-viewer with another $30/month cost.
Step 8: Check Pod Distribution
In eks-node-viewer, you can see exactly how pods are distributed:
# Run with pods resource
eks-node-viewer --resources cpu,memory,pods
Output:
1 nodes (1850m/1930m) 95.9% cpu โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ $0.042/hour | $30.368/month
1640Mi/3376720Ki 49.8% memory โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
29/110 pods 26.4% pods โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
29 pods (0 pending 29 running 29 bound)
New info:
- 29/110 pods - You have 29 pods running, max capacity is 110 pods per node
- 26.4% pods - You're using 26% of pod capacity
This is useful for understanding if you're hitting pod limits (which can happen before CPU/memory limits).
๐ธ Screenshot this!
Step 9: Cleanup (Watch Resources Free Up)
Let's clean up and watch the resources free up in real-time:
# Delete deployments (Terminal 2)
kubectl delete deployment nginx stress
# Watch pods terminating
kubectl get pods
In eks-node-viewer:
1 nodes (550m/1930m) 28.5% cpu โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ $0.042/hour | $30.368/month
540Mi/3376720Ki 16.4% memory โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
6 pods (0 pending 6 running 6 bound)
Back to baseline!
- CPU: 95.9% โ 28.5%
- Memory: 49.8% โ 16.4%
- Pods: 29 โ 6
- Cost: Still $30/month (node still exists)
๐ธ Screenshot this!
๐ฏ Real-World Use Cases
Use Case 1: "Why is my bill so high?"
Before eks-node-viewer:
- Open AWS Console
- Go to EC2 โ Instances
- Filter by cluster
- Manually check instance types
- Look up pricing
- Calculate total
- Check utilization in Grafana
- Realize you have 10 nodes at 20% utilization ๐ฑ
With eks-node-viewer:
eks-node-viewer --resources cpu,memory
Output:
10 nodes (2000m/19300m) 10.4% cpu โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ $0.416/hour | $303.68/month
5400Mi/33767200Ki 16.4% memory โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
60 pods (0 pending 60 running 60 bound)
Instant insight: You're paying $303/month for 10 nodes that are only 10% utilized. You could consolidate to 2-3 nodes and save $200/month.
Time saved: 15 minutes โ 30 seconds
Use Case 2: "Pods are pending"
Scenario: You deploy a new app and pods are stuck in Pending state.
kubectl get pods
# NAME READY STATUS RESTARTS AGE
# my-app-7d8f9c5b-xk2lp 0/1 Pending 0 2m
Check eks-node-viewer:
3 nodes (5700m/5790m) 98.4% cpu โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ $0.126/hour | $91.10/month
11200Mi/10130160Ki 113.2% memory โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
85 pods (5 pending 80 running 80 bound)
Instant insight: Nodes are at 98% CPU and 113% memory (overcommitted). You need more nodes.
Solution: Scale up or let Karpenter add nodes.
Use Case 3: "Is Karpenter working?"
Scenario: You installed Karpenter but you're not sure if it's actually consolidating nodes.
Terminal 1: Run eks-node-viewer
eks-node-viewer --resources cpu,memory
Terminal 2: Scale down workload
kubectl scale deployment my-app --replicas=2
Watch eks-node-viewer:
- After 30 seconds (Karpenter's default consolidation delay)
- You should see nodes disappear
- Cost should decrease
If nodes DON'T disappear: Karpenter isn't working. Check your NodePool configuration.
Use Case 4: "On-Demand vs Spot Cost Comparison"
Filter by capacity type:
# Show only On-Demand nodes
eks-node-viewer --node-selector karpenter.sh/capacity-type=on-demand
# Show only Spot nodes
eks-node-viewer --node-selector karpenter.sh/capacity-type=spot
Example output:
On-Demand:
5 nodes (5000m/9650m) 51.8% cpu โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ $0.208/hour | $151.84/month
Spot:
5 nodes (5000m/9650m) 51.8% cpu โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ $0.062/hour | $45.26/month
Instant insight: Same workload, same utilization, but Spot is 70% cheaper ($151 vs $45).
๐งน Cleanup
When you're done with the demo:
# Delete deployments
kubectl delete deployment nginx stress
# Delete cluster
eksctl delete cluster --name eks-node-viewer-demo --region us-east-1
# Verify deletion
aws eks list-clusters --region us-east-1
๐ฏ Key Takeaways
What eks-node-viewer Shows You
โ
Real-time cost - Per hour and per month
โ
Instance types - t3.medium, c6a.2xlarge, etc.
โ
Capacity type - On-Demand vs Spot
โ
Resource usage - CPU, Memory, Pods
โ
Utilization bars - Visual representation
โ
Pod distribution - How many pods per node
When to Use It
โ
Cost visibility - Quick cost checks
โ
Capacity planning - Before deploying new apps
โ
Debugging - Why are pods pending?
โ
Karpenter monitoring - Is consolidation working?
โ
Optimization - Finding underutilized nodes
Why It's Better Than Alternatives
โ
No setup - Just install and run
โ
No dashboard - Works in terminal
โ
Real-time - Updates as things change
โ
Cost-aware - Shows pricing automatically
โ
Fast - Answer questions in seconds
๐ Try It Yourself
5-minute quick start:
# 1. Install
go install github.com/awslabs/eks-node-viewer/cmd/eks-node-viewer@latest
# 2. Set region
export AWS_REGION=us-east-1
# 3. Run
eks-node-viewer --resources cpu,memory
# 4. Deploy something
kubectl create deployment nginx --image=nginx --replicas=10
# 5. Watch it update!
That's it. You'll get it immediately.
๐ Resources
- GitHub: https://github.com/awslabs/eks-node-viewer
- Karpenter Docs: https://karpenter.sh
- EKS Best Practices: https://aws.github.io/aws-eks-best-practices/
- AWS Pricing: https://aws.amazon.com/ec2/pricing/
๐ฌ Final Thoughts
eks-node-viewer is one of those tools that seems simple but becomes indispensable once you start using it.
Before: Checking costs meant opening 5 tabs, clicking through dashboards, and doing mental math.
After: One command. Instant visibility. Make decisions in seconds.
If you run EKS (especially with Karpenter), try this once. You'll understand why it's underrated.
Have you used eks-node-viewer? What's your favorite use case? Let me know in the comments! ๐
AWS #EKS #Kubernetes #Karpenter #DevOps #CloudCost #CostOptimization #eks-node-viewer
Happy Learning
Prithiviraj Rengarajan
DevOps Engineer


Top comments (0)