{"id":25323868,"url":"https://github.com/miltlima/kom","last_synced_at":"2025-10-29T02:31:00.745Z","repository":{"id":184893670,"uuid":"672630918","full_name":"miltlima/kom","owner":"miltlima","description":"Kom -  Is a command-line tool written in Go that allows you to display Kubernetes metrics","archived":false,"fork":false,"pushed_at":"2023-09-18T18:17:00.000Z","size":57,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-09-18T23:28:50.193Z","etag":null,"topics":["golang","kubernetes","metrics","nodes","pods"],"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/miltlima.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-30T18:23:04.000Z","updated_at":"2023-08-31T17:36:23.000Z","dependencies_parsed_at":"2023-07-30T20:25:03.124Z","dependency_job_id":"ea67d902-2da7-4bc6-8566-bac978d8c8bc","html_url":"https://github.com/miltlima/kom","commit_stats":null,"previous_names":["miltlima/kom"],"tags_count":4,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miltlima%2Fkom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miltlima%2Fkom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miltlima%2Fkom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miltlima%2Fkom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miltlima","download_url":"https://codeload.github.com/miltlima/kom/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238759696,"owners_count":19525873,"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":["golang","kubernetes","metrics","nodes","pods"],"created_at":"2025-02-14T00:54:48.103Z","updated_at":"2025-10-29T02:31:00.416Z","avatar_url":"https://github.com/miltlima.png","language":"Go","funding_links":["https://www.buymeacoffee.com/miltlima"],"categories":[],"sub_categories":[],"readme":"[![\"Buy Me A Coffee\"](https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge\u0026logo=buy-me-a-coffee\u0026logoColor=black)](https://www.buymeacoffee.com/miltlima)\n\n# KOM - Kubernetes Object Metrics CLI tool\n\nKom is a command-line tool written in Go that allows you to display Kubernetes metrics for nodes and pods. It provides an easy way to monitor resource usage and quickly identify performance issues in your Kubernetes cluster.\n\n## Features\n\n- View CPU and memory usage metrics for all nodes in the cluster.\n- View CPU and memory usage metrics for all pods in the cluster.\n- View Logs from pods and save inside folder komlogs\n- Color-coded output for easy visualization of resource usage levels.\n\n### Color-Coded Output\n\nKom uses color-coding to visualize resource usage levels:\n\n- CPU usage above 80% is displayed in red.\n- CPU usage between 50% and 80% is displayed in yellow.\n- CPU usage below 50% is displayed in green.\n- Memory usage above 80% is displayed in red.\n- Memory usage between 50% and 80% is displayed in yellow.\n- Memory usage below 50% is displayed in green.\n\n## Installation\n\nAssuming you have Git and Go installed on your system, here's what you can do:\n\nClone the repository:\n\n```bash\ngit clone https://github.com/miltlima/kom.git\n```\n\nChange to the project directory:\n\n```bash\ncd kom\n```\n\nBuild the binary:\n\n```bash\ngo build\n```\n\nThis will generate a binary file named \"kom\" in the project directory.\n\n```bash\nsudo mv kom /usr/local/bin\n```\n\nNow, the \"kom\" binary is located in your bin folder, and you can run it from any terminal window as long as the bin folder is in your system's PATH.\n\nSave the file and either restart your terminal or run source to apply the changes:\n\n```bash\nsource ~/.bashrc\n```\n\nOr\n\n```bash\nsource ~/.bash_profile\n```\n\nNow, you should be able to run the \"kom\" command from anywhere in your terminal.\n\n## Usage\n\n## Kom nodes\n\nTo display metrics for all nodes in the Kubernetes cluster, use the following command:\n\n```bash\nkom nodes\n```\n\nThis will show a table with information about each node's CPU usage, memory usage, and IP addresses.\n\n```bash\n❯ ./kom nodes\n\n+-------+-----------+-------------+----------------+----+-----------------------------------------------------------+\n| NODE  |    IP     | CPU USAGE % | MEMORY USAGE % | H  |                      STATUS - LABELS                      |\n+-------+-----------+-------------+----------------+----+-----------------------------------------------------------+\n| node1 | 10.0.0.11 | 7           | 42             | 🟩 | OK, Has Labels: node-role.kubernetes.io/control-plane=,   |\n|       |           |             |                |    | node.kubernetes.io/exclude-from-external-load-balancers=, |\n|       |           |             |                |    | beta.kubernetes.io/arch=arm64,                            |\n|       |           |             |                |    | beta.kubernetes.io/os=linux, kubernetes.io/arch=arm64,    |\n|       |           |             |                |    | kubernetes.io/hostname=node1, kubernetes.io/os=linux      |\n| node2 | 10.0.0.12 | 2           | 44             | 🟩 | OK, Has Labels:                                           |\n|       |           |             |                |    | kubernetes.io/arch=arm64,                                 |\n|       |           |             |                |    | kubernetes.io/hostname=node2,                             |\n|       |           |             |                |    | kubernetes.io/os=linux,                                   |\n|       |           |             |                |    | beta.kubernetes.io/arch=arm64,                            |\n|       |           |             |                |    | beta.kubernetes.io/os=linux                               |\n| node3 | 10.0.0.13 | 2           | 37             | 🟩 | OK, Has Labels:                                           |\n|       |           |             |                |    | kubernetes.io/os=linux,                                   |\n|       |           |             |                |    | beta.kubernetes.io/arch=arm64,                            |\n|       |           |             |                |    | beta.kubernetes.io/os=linux,                              |\n|       |           |             |                |    | kubernetes.io/arch=arm64,                                 |\n|       |           |             |                |    | kubernetes.io/hostname=node3                              |\n| node4 | 10.0.0.14 | 4           | 36             | 🟩 | OK, Has Labels:                                           |\n|       |           |             |                |    | kubernetes.io/hostname=node4,                             |\n|       |           |             |                |    | kubernetes.io/os=linux,                                   |\n|       |           |             |                |    | beta.kubernetes.io/arch=arm64,                            |\n|       |           |             |                |    | beta.kubernetes.io/os=linux,                              |\n|       |           |             |                |    | kubernetes.io/arch=arm64                                  |\n+-------+-----------+-------------+----------------+----+-----------------------------------------------------------+\n\n```\n\n## Kom pods\n\nTo display metrics for all pods in the Kubernetes cluster, use the following command:\n\n```bash\nkom pods\n```\n\nThis will show a table with information about each node, pod's namespace, name, CPU usage, memory usage, and IP.\n\n```bash\n❯ ./kom pods\n+-------+-------------+--------------------------------------------------+-----------+-------------+----------------+----+\n| NODE  |  NAMESPACE  |                       POD                        |  POD IP   | CPU USAGE % | MEMORY USAGE % | H  |\n+-------+-------------+--------------------------------------------------+-----------+-------------+----------------+----+\n| node2 | default     | build-code-deployment-68dd47875-4bt5p            | 10.36.0.1 | 0           | 0              | 🟩 |\n| node2 | default     | health-check-deployment-59f4b679b-8k4pj          | 10.36.0.5 | 0           | 0              | 🟩 |\n| node3 | default     | hidden-in-layers-qtst5                           | 10.44.0.1 | 0           | 0              | 🟩 |\n| node2 | default     | internal-proxy-deployment-7699c5dd65-xm4tw       | 10.36.0.3 | 0           | 0              | 🟩 |\n| node2 | default     | kubernetes-goat-home-deployment-7bf7785ff5-gghts | 10.36.0.2 | 0           | 0              | 🟩 |\n| node4 | default     | metadata-db-648b64948f-vjvsg                     | 10.42.0.1 | 0           | 0              | 🟩 |\n| node2 | default     | poor-registry-deployment-75f47d55dc-vhs9d        | 10.36.0.4 | 0           | 0              | 🟩 |\n| node4 | default     | system-monitor-deployment-674bb4dc65-9wj4m       | 10.42.0.3 | 0           | 0              | 🟩 |\n| node1 | kube-system | coredns-787d4945fb-4vnqj                         | 10.32.0.3 | 0           | 0              | 🟩 |\n| node1 | kube-system | coredns-787d4945fb-q5r2h                         | 10.32.0.2 | 0           | 0              | 🟩 |\n| node1 | kube-system | etcd-node1                                       | 10.0.0.11 | 1           | 1              | 🟩 |\n| node1 | kube-system | kube-apiserver-node1                             | 10.0.0.11 | 3           | 8              | 🟩 |\n| node1 | kube-system | kube-controller-manager-node1                    | 10.0.0.11 | 0           | 0              | 🟩 |\n| node4 | kube-system | kube-proxy-5r278                                 | 10.0.0.14 | 0           | 0              | 🟩 |\n| node3 | kube-system | kube-proxy-dzzrp                                 | 10.0.0.13 | 0           | 0              | 🟩 |\n| node1 | kube-system | kube-proxy-h5wsb                                 | 10.0.0.11 | 0           | 0              | 🟩 |\n| node2 | kube-system | kube-proxy-htlwv                                 | 10.0.0.12 | 0           | 0              | 🟩 |\n| node1 | kube-system | kube-scheduler-node1                             | 10.0.0.11 | 0           | 0              | 🟩 |\n| node4 | kube-system | metrics-server-75fcb88b7d-n2l7p                  | 10.0.0.14 | 0           | 0              | 🟩 |\n| node4 | kube-system | weave-net-774l4                                  | 10.0.0.14 | 0           | 0              | 🟩 |\n| node3 | kube-system | weave-net-gv6dn                                  | 10.0.0.13 | 0           | 0              | 🟩 |\n| node2 | kube-system | weave-net-n6n8f                                  | 10.0.0.12 | 0           | 0              | 🟩 |\n| node1 | kube-system | weave-net-sn6v9                                  | 10.0.0.11 | 0           | 0              | 🟩 |\n+-------+-------------+--------------------------------------------------+-----------+-------------+----------------+----+\n```\n\n## Kom logs\n\nThe logs command in the kom CLI allows you to collect logs from a Kubernetes pod and optionally save them to a file.\n\n```bash\nkom logs \u003cpod-name\u003e [flags]\n```\n\n### Arguments\n\n`\u003cpod-name\u003e`: The name of the pod from which you want to collect logs.\n\n### Flags\n\n```bash\n-s, --save: (Optional) Save the output to a log file. If this flag is not provided, the logs will be displayed in the terminal.\n-o, --output \u003cfile-path\u003e: (Optional) Specify the file path to save the logs. Default is output.log in the komlogs folder.\n-n, --namespace \u003cnamespace\u003e: (Optional) Specify the namespace of the pod. Default is default.\n-c, --container \u003ccontainer-name\u003e: (Optional) Specify the name of the container in the pod. If not provided, logs will be collected from the first container in the pod.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiltlima%2Fkom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiltlima%2Fkom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiltlima%2Fkom/lists"}