{"id":13644054,"url":"https://github.com/vladimirvivien/ktop","last_synced_at":"2025-05-14T20:10:52.733Z","repository":{"id":37359326,"uuid":"77647025","full_name":"vladimirvivien/ktop","owner":"vladimirvivien","description":"A top-like tool for your Kubernetes clusters","archived":false,"fork":false,"pushed_at":"2025-05-06T14:21:00.000Z","size":9998,"stargazers_count":857,"open_issues_count":13,"forks_count":19,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-06T15:43:16.998Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vladimirvivien.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":"2016-12-29T23:55:12.000Z","updated_at":"2025-05-06T14:20:57.000Z","dependencies_parsed_at":"2024-01-13T16:20:46.819Z","dependency_job_id":"bfda40c3-fa02-4fec-9445-37169d5ce59c","html_url":"https://github.com/vladimirvivien/ktop","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladimirvivien%2Fktop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladimirvivien%2Fktop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladimirvivien%2Fktop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladimirvivien%2Fktop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vladimirvivien","download_url":"https://codeload.github.com/vladimirvivien/ktop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254219374,"owners_count":22034397,"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":[],"created_at":"2024-08-02T01:01:56.910Z","updated_at":"2025-05-14T20:10:52.712Z","avatar_url":"https://github.com/vladimirvivien.png","language":"Go","funding_links":[],"categories":["others","\u003ca name=\"devops\"\u003e\u003c/a\u003eDevOps","Go","Table of Contents"],"sub_categories":[],"readme":"# ktop\n\n\u003ch1 align=\"center\"\u003e\n    \u003cimg src=\"./docs/ktop.png\" alt=\"ktop\"\u003e\n\u003c/h1\u003e\n\nA `top`-like tool for your Kubernetes cluster.\n\nFollowing the tradition of Unix/Linux `top` tools, `ktop` is a tool that displays useful metrics information about nodes, pods, and other workload resources running in a Kubernetes cluster.\n\n## Features\n\n* Insightful summary of cluster resource metrics\n* Ability to work with or without a metrics-server deployed\n* Displays nodes and pods usage metrics when a Metrics Server is found\n* Uses your existing cluster configuration to connect to a cluster's API server\n\n## Installing ktop\n\n### kubectl `ktop` plugin\n\nProject `ktop` is distributed as a kubectl plugin.  To use ktop as a plugin do the followings:\n\n* [Install](https://krew.sigs.k8s.io/docs/user-guide/setup/install/) `krew` plugin manager (if not present)\n* Ensure ktop is available to be installed: `kubectl krew search ktop`\n* Next, install the plugin: `kubectl krew install ktop`\n\nOnce installed, start the ktop plugin with\n\n```\nkubectl ktop\n```\n\n### Homebrew installation\n`ktop` is also available via the `brew` package manager. \n\n#### OSX / Linux\n\n```\nbrew tap vladimirvivien/oss-tools\nbrew install ktop\n```\n\n### Using a container\nThe binary is relased as an OCI container at `ghcr.io/vladimirvivien/ktop`.\nIf you have a container runtime installed (Docker for instance), you launch ktop as shown below:\n\n```\nexport KUBECONFIG=/home/user/.kube/config\ndocker run --network=host --rm --platform=\"linux/arm64\" -it -v $KUBECONFIG:/config -e KUBECONFIG=/config -e TERM=xterm-256color ghcr.io/vladimirvivien/ktop:latest\n```\n\n### Using `go install`\n\nIf you have a recent version of Go installed (1.14 or later) you can build and install ktop as follows:\n\n```\ngo install github.com/vladimirvivien/ktop@latest\n```\n\nThis should place the ktop binary in your configured `$GOBIN` path or place it in its default location, `$HOME/go/bin`.\n\n### Download binary\n\nAnother easy way to get started with ktop is to download the pre-built binary directly (for your system):\n\n\u003e https://github.com/vladimirvivien/ktop/releases/latest\n\nThen, extract the ktop binary and copy it to your system's execution path.\n\n\n### Build from source\n\nDownload or clone the source (from GitHub). From the project's root directory, do the following:\n\n```\ngo build .\n```\n\nThe project also comes with a Go program that you can use for cross-platform builds.\n```\ngo run ./ci/build.go\n```\n\n## Running ktop\n\nWith a locally accessible kubeconfig file on your machine, ktop can be executed simply:\n\n```\nktop\n```\n\nThe previous command will use either environment variable `$KUBECONFIG` or the default path for the kubeconfig file. The program currently accepts the following arguments:\n\n```\nUsage:\n  ktop [flags]\n\nFlags:\n  -A, --all-namespaces                 If true, display metrics for all accessible namespaces\n      --as string                      Username to impersonate for the operation. User could be a regular user or a service account in a namespace.\n      --as-group stringArray           Group to impersonate for the operation, this flag can be repeated to specify multiple groups.\n      --as-uid string                  UID to impersonate for the operation.\n      --cache-dir string               Default cache directory (default \"${HOME}/.kube/cache\")\n      --certificate-authority string   Path to a cert file for the certificate authority\n      --client-certificate string      Path to a client certificate file for TLS\n      --client-key string              Path to a client key file for TLS\n      --cluster string                 The name of the kubeconfig cluster to use\n      --context string                 The name of the kubeconfig context to use\n  -h, --help                           help for ktop\n      --insecure-skip-tls-verify       If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure\n      --kubeconfig string              Path to the kubeconfig file to use for CLI requests.\n  -n, --namespace string               If present, the namespace scope for this CLI request\n      --request-timeout string         The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default \"0\")\n  -s, --server string                  The address and port of the Kubernetes API server\n      --tls-server-name string         Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used\n      --token string                   Bearer token for authentication to the API server\n      --user string                    The name of the kubeconfig user to use```\n```\n\nFor instance, the following will show cluster information for workload resources associated with namespace `my-app` in context `web-cluster` using the default kubconfig file path:\n\n```\nktop --namespace my-app --context web-cluster\n```\n\n## ktop metrics\n\nThe ktop UI provides several metrics including a high-level summary of workload components installed on your cluster:\n\n\u003ch1 align=\"center\"\u003e\n    \u003cimg src=\"./docs/ktop-cluster-summary.png\" alt=\"ktop\"\u003e\n\u003c/h1\u003e\n\n### Usage metrics from `metrics-server`\n\nktop can display metrics with or without Metrics Server present.  When a cluster has an instance of a [kubernetes-sigs/metrics-server](https://github.com/kubernetes-sigs/metrics-server) installed (and properly configured), ktop will automatically discover the server as shown:\n\n\u003ch1 align=\"center\"\u003e\n    \u003cimg src=\"./docs/ktop-metrics-connected.png\" alt=\"ktop\"\u003e\n\u003c/h1\u003e\n\nWith the metrics server installed, ktop will display resource utilization metrics as reported by the Metrics Server.\n\n### Request/limit metrics\n\nWhen there is no Metrics Server present in the cluster, ktop will still work:\n\n\u003ch1 align=\"center\"\u003e\n    \u003cimg src=\"./docs/ktop-metrics-not-connected.png\" alt=\"ktop\"\u003e\n\u003c/h1\u003e\n\nInstead of resource utilization, ktop will display resource requests and limits for nodes and pods.\n\n## Known issue\nFor ktop to work properly, the user account that is used (from the Kubernetes config) must have access rights to the following API objects, and their metrics: \n\n* Nodes (and metrics)\n* Pods (and metrics)\n* Deployments,\n* PV, PVCs\n* {Replica|Daemon|Stateful}Sets\n* Jobs\n\n\nWhen your Kubernetes user account does not have proper access rights,  you will see warning printed on the terminal, similar to the followings:\n\n```\nW0110 10:27:25.315399    1062 reflector.go:324] pkg/mod/k8s.io/client-go@v0.23.1/tools/cache/reflector.go:167: failed to list *unstructured.Unstructured: the server could not find the requested resource\nE0110 10:27:25.315485    1062 reflector.go:138] pkg/mod/k8s.io/client-go@v0.23.1/tools/cache/reflector.go:167: Failed to watch *unstructured.Unstructured: failed to list *unstructured.Unstructured: the server could not find the requested resource\nW0110 10:27:26.719264    1062 reflector.go:324] pkg/mod/k8s.io/client-go@v0.23.1/tools/cache/reflector.go:167: failed to list *unstructured.Unstructured: the server could not find the requested resource\nE0110 10:27:26.719345    1062 reflector.go:138] pkg/mod/k8s.io/client-go@v0.23.1/tools/cache/reflector.go:167: Failed to watch *unstructured.Unstructured: failed to list *unstructured.Unstructured: the server could not find the requested resource\n```\n\n### What to do\n\n`ktop` supports many additional CLI arguments to help you connect properly. You can set the following\narguments to adjust your connection parameters:\n\n* `--context` - context for cluster\n* `--user` - a user with proper access rights\n* `--as-{uid/group}` - if impersonating a different account\n\nThere are many other arguments that may be configured to create a successful connection to the API server.\nSee the full list of CLI arguments in the *Running ktop* section above.\n\n## Roadmap\n\n* A multi-page UI to display metrics for additional components\n* Display OOM processes\n* Additional installation methods (Homebrew, linux packages, etc)\n* Etc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladimirvivien%2Fktop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvladimirvivien%2Fktop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladimirvivien%2Fktop/lists"}