Blog

eks-node-viewer: A Tool for Visualizing Dynamic Node Usage in EKS Clustersย ๐Ÿš€
Photo by Saifeddine Rajhi

eks-node-viewer: A Tool for Visualizing Dynamic Node Usage in EKS Clustersย ๐Ÿš€

โ€ข 3mins read
  • eks-node-viewer
  • EKS clusters
  • DevOps
  • SRE

    Content

    Optimizing AWS Kubernetes Cluster

    ๐Ÿ”Š Introduction

    EKS Node Viewer is a tool for visualizing dynamic node usage within a Kubernetes cluster. It was originally developed as an internal tool at AWS for demonstrating consolidation with Karpenter, but it is now available to the public as an open-source project.

    EKS Node Viewer displays the scheduled pod resource requests vs the allocatable capacity on the node. This information can be used to identify nodes that are underutilized or overutilized and to make decisions about node scaling and consolidation.

    ๐ŸŽฏ Goals and Objectives

    In this blog post, we will introduce EKS Node Viewer and explain how to use it to improve your Kubernetes clusters. We will also discuss some of the benefits of using EKS Node Viewer and provide some tips for getting the most out of it.

    Definition and Usage

    EKS Node Viewer is a simple but powerful tool that can be used to improve the efficiency and performance of Kubernetes clusters. It is easy to use and install, and it provides a clear and concise view of node usage. It does not look at the actual pod resource usage.

    Node Viewer Output 1

    It also supports spot instances. Here is a small EKS cluster instance:

    Node Viewer Output 2

    ๐Ÿ› ๏ธ Installation

    Homebrew:

    brew tap aws/tap
    brew install eks-node-viewer

    Manual:

    Please either fetch the latest release or install manually using:

    go install github.com/awslabs/eks-node-viewer/cmd/eks-node-viewer@latest

    Note: This will install it to your GOBIN directory, typically ~/go/bin if it is unconfigured.

    ๐Ÿš€ Usage

    Usage of ./eks-node-viewer:
        -attribution
                Show the Open Source Attribution
        -context string
                Name of the kubernetes context to use
        -disable-pricing
                Disable pricing lookups
        -extra-labels string
                A comma separated set of extra node labels to display
        -kubeconfig string
                Absolute path to the kubeconfig file (default "~/.kube/config")
        -node-selector string
                Node label selector used to filter nodes, if empty all nodes are selected
        -resources string
                List of comma separated resources to monitor (default "cpu")
        -v	Display eks-node-viewer version
        -version
                Display eks-node-viewer version

    ๐Ÿ“‹ Examples

    # Standard usage
    eks-node-viewer
    
    # Karpenter nodes only
    eks-node-viewer --node-selector "karpenter.sh/provisioner-name"
    
    # Display both CPU and Memory Usage
    eks-node-viewer --resources cpu,memory
    
    # Display extra labels, i.e. AZ
    eks-node-viewer --extra-labels topology.kubernetes.io/zone
    
    # Specify a particular AWS profile and region
    AWS_PROFILE=myprofile AWS_REGION=us-west-2 eks-node-viewer

    ๐Ÿท๏ธ Computed Labels

    EKS Node Viewer supports some custom label names that can be passed to the --extra-labels to display additional node information.

    • eks-node-viewer/node-age - Age of the node
    • eks-node-viewer/node-cpu-usage - CPU usage (requests)
    • eks-node-viewer/node-memory-usage - Memory usage (requests)
    • eks-node-viewer/node-pods-usage - Pod usage (requests)
    • eks-node-viewer/node-ephemeral-storage-usage - Ephemeral Storage usage (requests)

    โš™๏ธ Default Options

    You can supply default options to EKS Node Viewer by creating a file named .eks-node-viewer in your home directory and specifying options there. The format is option-name=value where the option names are the command line flags:

    # select only Karpenter managed nodes
    node-selector=karpenter.sh/provisioner-name
    
    # display both CPU and memory
    resources=cpu,memory

    ๐Ÿ Conclusion

    EKS Node Viewer is a valuable tool for optimizing Kubernetes clusters and improving efficiency. By visualizing dynamic node usage, EKS Node Viewer can help you identify nodes that are underutilized or overutilized, and make decisions about node scaling and consolidation. This can lead to significant cost savings and improved performance.

    If you are running Kubernetes clusters on AWS, I highly recommend using EKS Node Viewer. It is easy to use and install, and it can provide valuable insights into your cluster usage.



    ๐Ÿ’ก Thank you for Reading !! ๐Ÿ™Œ๐Ÿป๐Ÿ˜๐Ÿ“ƒ, see you in the next blog.๐Ÿค˜ Until next time ๐ŸŽ‰

    ๐Ÿš€ Thank you for sticking up till the end. If you have any questions/feedback regarding this blog feel free to connect with me:

    โ™ป๏ธ LinkedIn: https://www.linkedin.com/in/rajhi-saif/

    โ™ป๏ธ X/Twitter: https://x.com/rajhisaifeddine

    The end โœŒ๐Ÿป

    ๐Ÿ”ฐ Keep Learning !! Keep Sharing !! ๐Ÿ”ฐ

    ๐Ÿ“… Stay updated

    Subscribe to our newsletter for more insights on AWS cloud computing and containers.