{"id":15292911,"url":"https://github.com/aksarav/kubenodeusage","last_synced_at":"2025-04-05T00:05:11.488Z","repository":{"id":65481874,"uuid":"583088155","full_name":"AKSarav/KubeNodeUsage","owner":"AKSarav","description":"Kubernetes Node Usage Visualizer to view Disk, Memory and CPU Usage - From Terminal","archived":false,"fork":false,"pushed_at":"2025-03-24T06:22:13.000Z","size":148830,"stargazers_count":187,"open_issues_count":1,"forks_count":16,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-05T00:05:02.759Z","etag":null,"topics":["containers","devops-tools","engineering","golang","kubernetes","terminal-app","tui"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AKSarav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-28T18:19:57.000Z","updated_at":"2025-04-01T17:38:08.000Z","dependencies_parsed_at":"2024-01-26T12:53:41.147Z","dependency_job_id":"a5cbf0d6-3663-4522-badd-8babecc494f3","html_url":"https://github.com/AKSarav/KubeNodeUsage","commit_stats":null,"previous_names":["aksarav/kubenodeusage","aksarav/kube-node-usage"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSarav%2FKubeNodeUsage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSarav%2FKubeNodeUsage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSarav%2FKubeNodeUsage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSarav%2FKubeNodeUsage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AKSarav","download_url":"https://codeload.github.com/AKSarav/KubeNodeUsage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266562,"owners_count":20910836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containers","devops-tools","engineering","golang","kubernetes","terminal-app","tui"],"created_at":"2024-09-30T16:31:38.036Z","updated_at":"2025-04-05T00:05:11.462Z","avatar_url":"https://github.com/AKSarav.png","language":"Go","readme":"\n# KubeNodeUsage\n\n![GitHub release](https://img.shields.io/github/v/release/AKSarav/Kube-Node-Usage?style=for-the-badge)![GitHub all releases](https://img.shields.io/github/downloads/AKSarav/Kube-Node-Usage/total?style=for-the-badge)![GitHub stars](https://img.shields.io/github/stars/AKSarav/Kube-Node-Usage?style=for-the-badge)\n\n![Go-Version](https://img.shields.io/github/go-mod/go-version/AKSarav/Kube-Node-Usage)![GitHub](https://img.shields.io/github/license/AKSarav/Kube-Node-Usage)![GitHub issues](https://img.shields.io/github/issues/AKSarav/Kube-Node-Usage)![GitHub pull requests](https://img.shields.io/github/issues-pr/AKSarav/Kube-Node-Usage)\n\n\n**KubeNodeUsage** is a Terminal App designed to provide insights into Kubernetes node and pod usage. It offers both interactive exploration and command-line filtering options to help you analyze your cluster effectively right from your terminal .\n\nAvailable to download from `Brew` and `Goinstall`\n\nYou no longer have to wait for that `prometheus` and `grafana` - Just check the usage visually right from terminal.\n\n![Alt text](assets/KubeNodeUsage3.0.4.gif)\n\nKubeNodeUsage use your local KubeConfig file to connect to the cluster and use Kubernetes API directly using Kubernetes GO SDK\n\nIt fetches the Node and Pod Metrics from Kubernetes API and apply filters and aggreations to display it in a nice human readable Graphical format as Bar Charts.\n\n\n\n## 🌟  Newly added Features ![v3.0.4](https://img.shields.io/badge/v3.0.4-8A2BE2)\n- **Smart Search**: Press `S` to instantly filter and highlight matching entries\n  - Real-time filtering as you type\n  - Headers remain visible for context\n  - Match count display\n  - Press ESC to exit search mode\n- **Horizontal Scrolling**: Use `←` and `→` arrows to view wide content\n  - Smooth scrolling for large tables\n  - Preserves column alignment\n- **New Pod Usage**:\n  - Now you can see Pod usage in KubeNodeUsage\n- **Extra fields in NodeUsage**\n  - Thanks to the Horizontal scrolling - we can show more fields like `Uptime` and `Status`\n- **More accurate diskusage calculation**\n  - Bringing you the accurate diskusage calculation for POD and Node using /stats/summary endpoint in Kubelet\n\n\n\n## 🚀 Existing Features \n\n- Filter output by Node, Color, Label\n- Display any specific Node Label as a Custom field\n- Metrics are dynamically updated every 2 seconds, so you get the real time data always\n- Choose to not display the ClusterInfo for additional security\n- No data collected everything is local\n- Sorting with Ascending and Descending\n\n### Options for Filtering and Sorting\nPerfect for scripting and automation:\n- **Node/Pod Filtering**: \n  - `--filternodes`: Filter by node name using regex\n  - `--filtercolor`: Filter by usage levels (green/orange/red)\n  - `--filterlabel`: Filter by label key-value pairs\n- **Sorting Options**:\n  - `--sortby`: Sort by various metrics (name, free, usage, etc.)\n  - `--desc`: Reverse sort order\n- **Display Options**:\n  - `--noinfo`: To not display the Cluster information ( can sometimes be confidential ) - Default is to display\n  - `--label`: To display a specific lable with custom FieldName\n\n\n\n\u0026nbsp;\n\n\u003e Refer the Options and Screenshots section for more details\n\n\u0026nbsp;\n## Screenshots 📸\n\n:sparkle: Screenshot of Latest Version 3.0.1 with Cluster Info \n\n![Alt text](assets/KubeNodeUsageV3.0.1.png)\n\n:sparkle: Screenshot of Version 3.0.2 with Label Column and Total Pods Count with `-noinfo` flag ( to turn off Cluster Info) \n\n![Alt text](assets/KubeNodeUsage-V3.0.2.png)\n\n:sparkle: Screenshot of Multiple RegEx patterns with FilterNodes\n\n![Alt text](assets/filternodes-regex.png)\n\n\u0026nbsp;\n\n:sparkle: Screenshot of Label Filtering with FilterLabel\n\n![Alt text](assets/KubeNodeUsage-FilterLabel.png)\n\n:sparkle: Screenshot of Search and PodUsage\n![Alt text](assets/KubeNodeUsagev3.0.4.png)\n\n:sparkle: More powerful DiskUsage for Pods and Nodes powered by Kubelet /stats endpoint\n\n![Alt text](assets/KubeNodeUsage-Disk-Pods.png)\n\n:sparkle: Pods Memory by Sort - All the filters and sorts are available for Pods too\n\n![Alt text](assets/KubeNodeUsageMemorySort.png)\n\n## Kubernetes Supported Versions / Clusters :white_check_mark:\n\nAs KubeNodeUsage use the Kubernetes Go SDK and directly connects to the API - It supports all the Kubernetes cluster which supports `.kube/config` file based authentication \n\n**Clusters**\n\nI have tested it with the following K8s clusters\n\n* EKS - Elastic Kubernetes Service from AWS\n* Azure Kubernetes Service\n* GKE - Google Kubernetes Engine\n* Minikube\n* Kind Cluster\n* Rancher Kubernetes Engine\n\n**Versions**\n\nI have tested KubeNodeUsage starting from **1.19 - 1.29** ( the latest stable version as of 30th June)\n\n\u0026nbsp; \n\n## How it Works :bulb:\n\nKubeNodeUsage is written in `GoLang` and uses `client-go` and `kubernetes` SDK libraries\n\nWhen you start KubeNodeUsage - It try to read the `$HOME/.kube/config` file in your HOME directory\n\nKubeNodeUsage connects to the Default cluster set by the `CurrentContext` on the ./kube/config file\n\nYou can manually edit this file and update it but the recommended way to update current-context is to use `kubectl config use-context`\n\nKubeNodeUsage does not use `kubectl` directly and it relies on the `.kube/config` file and the authentication method defined in there\n\nKubeNodeUsage works the same way - kubectl works based on the configuration information found on .kube/config file\n\nIf the `kubectl`commands are not working - its highly likely KubeNodeUsage would fail too - In this case you have to check your Kube config file\n\n\u0026nbsp; \n\n#### Is it secure ? How about Data Privacy :lock:\nKubeNodeUsage do not collect any data of your cluster or usage. \n\u0026nbsp;\n\n## How to Download :arrow_double_down:\n\nYou can clone this project and run it as shown below\n\n#### Brew Install 🍺\n\n```\nbrew tap AKSarav/kubenodeusage\nbrew install kubenodeusage\n```\n\n\u003e Note: If you are using Brew install - You have to use all lowercase letters for the command `kubenodeusage` instead of `KubeNodeUsage` \n\n#### With GO install command  🚀\n\n```\ngo install github.com/AKSarav/KubeNodeUsage/v3@v3.0.3\n\n```\n\n#### Clone and Run 👨‍💻\n\n```\ngit clone https://github.com/AKSarav/KubeNodeUsage.git\ncd Kube-Node-Usage\ngo run main.go\n```\n\n#### Download the Binaries from the Release Page 📦\n\nGoto the https://github.com/AKSarav/KubeNodeUsage/releases and download the suitable binary for your OS and use it\n\n```\nunzip KubeNodeUsage-windows-386.exe.zip\n./KubeNodeUsage-windows-386\n```\n\n\u0026nbsp;\n\n## How to use :book:\n\nKubeNodeUsage is a command line utility with lot of startup options/flags \n\n\n```bash\nKubeNodeUsage [options]\n```\n\nYou can find the detail information on all available options here\n\n\u0026nbsp;\n**Available Options** :memo:\n\n- `help`: Display help information.\n\n- `noinfo` : Disable the Cluster Info display. ( New feature in V3.0.2)\n\n- `metrics`: Choose which metric to display. Valid options include:\n\n    - memory\n    - disk\n    - cpu\n\n- `filternodes`: Filter nodes based on node name using a regular expression. (Note: Only one filter can be used at a time, and the input should be enclosed in quotes.)\n\n- `filtercolor`: Filter nodes based on color categories. Valid options include:\n\n    - `red` \n    - `green`\n    - `orange`\n\n- `filterlabel`: Filter nodes based on the label key-value pair. ( New feature in V3.0.2) Syntax is `--filterlabel=\u003clabel-key\u003e=\u003clabel-value\u003e`\n\n- `debug`: Enable debug mode. ( Prints more logging for debug)\n\n- `sortby`: Sort the output by a specific metric. Valid options include:\n\n    - `name` (Sort by node name alphabetically)\n    - `node` (Sort by node name alphabetically, same as 'name')\n\n    - `free` (Sort by available resources)\n\n    - `usage` (Sort by resource usage)\n    - `color` (Sort by color category, same as usage)\n\n    - `capacity` (Sort by resource capacity)\n    - `max` (Sort by maximum resource value, same as 'capacity')\n-  `desc`: Enable reverse sort order.\n-  `label`: Display the Label information as a new column in the output. ( New feature in V3.0.2) Syntax is `--label=\u003clabel-key\u003e#\u003ccolumnname\u003e`\n  \n\n\u0026nbsp;\n## Examples 📝\n\n```bash\n# Display help information\nKubeNodeUsage --help\n\n# Display node usage with default settings (memory is the default metric)\nKubeNodeUsage\n\n# To disable the Cluster Info display use --noinfo flag with any other options\nKubeNodeUsage --noinfo\nKubeNodeUsage --noinfo --metrics cpu\nKubeNodeUsage --noinfo --metrics cpu --sortby usage --desc\n\n# Display node usage sorted by node name\nKubeNodeUsage --sortby name\n\n# Display node usage sorted by free resources in descending order\nKubeNodeUsage --sortby free --desc\n\n# Display node usage sorted by usage in ascending order\nKubeNodeUsage --sortby usage\n\n# Display node usage sorted by capacity in descending order\nKubeNodeUsage --sortby capacity --desc\n\n# Filter nodes with a name starting with \"web\" - supports regular expression\nKubeNodeUsage --filternodes \"web.*\"\n\n# Filter nodes with color category \"green\"\nKubeNodeUsage --filtercolor green\n\n# Display memory usage for all nodes\nKubeNodeUsage --metrics memory\n\n# Display disk usage for nodes with a name containing \"data\"\nKubeNodeUsage --metrics disk --filternodes \".*data.*\"\n\n# Show CPU usage for nodes with color category \"red\" in descending order\nKubeNodeUsage --metrics cpu --filtercolor red --desc\n\n# Display node usage sorted by maximum resource value in ascending order\nKubeNodeUsage --sortby max\n\n# Display node usage sorted by capacity, show memory usage, and filter nodes with a name starting with \"prod\"\nKubeNodeUsage --sortby capacity --metrics memory --filternodes \"prod.*\"\n\n# Show CPU usage for nodes with a name containing \"IP range\" - here we are using multiple regex patterns as comma separated values\nKubeNodeUsage --metrics cpu --filternodes \".*172-31.*\",\".*172-32.*\"\n\n# Display node usage sorted by name, filter nodes with a name starting with \"app\", and enable debug mode\nKubeNodeUsage --sortby name --filternodes \"app.*\" --debug\n\n# Display Label as a new column in the output. use the `--label` the syntax is \"--label=\u003clabel-name\u003e:\u003calias/columnname\u003e\" ( New feature in V3.0.2)\nKubeNodeUsage --label eks.amazonaws.com/capacityType#capacity \nKubeNodeUsage --label beta.kubernetes.io/instance-type#InstanceType \n\n# Filter Nodes based on Label Key Value pair ( New feature in V3.0.2)\nKubeNodeUsage --filterlabel eks.amazonaws.com/capacityType=OnDemand\nKubeNodeUsage --filterlabel beta.kubernetes.io/instance-type=t3.medium\nKubeNodeUsage --filterlabel topology.kubernetes.io/zone=us-east-1a\n\n\n```\n\n\u0026nbsp;\n\n### Contributions / Feature Requests are welcome :handshake:\n\nFeel free to send your Pull requests and Issues to make this better.\n\n\u0026nbsp;\n\n\u003ePlease share and Leave a **Github Star** :star: :star: :star: :star:  if you like KubeNodeUsage - It would motivate me\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faksarav%2Fkubenodeusage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faksarav%2Fkubenodeusage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faksarav%2Fkubenodeusage/lists"}