{"id":21100284,"url":"https://github.com/pscheidl/kubectl-explorer","last_synced_at":"2025-05-08T00:27:05.609Z","repository":{"id":42018259,"uuid":"386992088","full_name":"Pscheidl/kubectl-explorer","owner":"Pscheidl","description":"Detects orphan configmaps and secrets in a Kubernetes cluster","archived":false,"fork":false,"pushed_at":"2025-03-30T11:54:49.000Z","size":154,"stargazers_count":60,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T12:29:40.489Z","etag":null,"topics":["kubernetes","kubernetes-tools","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/Pscheidl.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":"2021-07-17T16:48:46.000Z","updated_at":"2025-03-30T11:50:27.000Z","dependencies_parsed_at":"2024-08-15T11:59:00.751Z","dependency_job_id":"4683dd5b-68ab-4a20-bb94-461e2e733bf2","html_url":"https://github.com/Pscheidl/kubectl-explorer","commit_stats":null,"previous_names":["pscheidl/kubectl-explorer"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pscheidl%2Fkubectl-explorer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pscheidl%2Fkubectl-explorer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pscheidl%2Fkubectl-explorer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pscheidl%2Fkubectl-explorer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pscheidl","download_url":"https://codeload.github.com/Pscheidl/kubectl-explorer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252975427,"owners_count":21834440,"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":["kubernetes","kubernetes-tools","rust"],"created_at":"2024-11-19T23:09:24.134Z","updated_at":"2025-05-08T00:27:05.556Z","avatar_url":"https://github.com/Pscheidl.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubectl explorer plugin - orphan detection\n[![Rust build \u0026 tests](https://github.com/Pscheidl/kubexplorer/actions/workflows/rust.yml/badge.svg)](https://github.com/Pscheidl/kubexplorer/actions/workflows/rust.yml)\n\nA kubectl plugin to explore **orphan** `configmaps` and `secrets`. Can be used standalone. \n\nNew issues or any kind of feedback are most welcome. \n\n## Orphan detection\n\nDiscovers and prints out any `Configmaps` and `Secrets` not linked to any of the following resources:\n1. Deployments,\n2. ReplicaSets,\n3. StatefulSets,\n4. DaemonSets,\n5. Jobs,\n6. CronJobs,\n7. ReplicationControllers,\n8. Pods,\n9. Ingresses,\n10. ServiceAccounts.\n\n## Usage\n\nThe [recommended](#kubectl-plugin) way is to use `kubectl-explore` as a `kubectl` plugin. Alternatively, because every [kubectl plugin](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/)\nis a standalone binary, it can be used [directly](#standalone).\n\n### Kubectl plugin\n\n1. Download a [pre-compiled](https://github.com/Pscheidl/kubexplorer/releases) binary, or compile [from the source](#optional-compiling-and-running-from-source).\n2. Add kubectl-explore to path, e.g. to add temporarily use `export PATH=\"/path/to/kubectl-explore:$PATH\"`.\n3. Invoke `kubectl plugin list` - kubectl-explore should be on the list, automatically discovered by `kubectl`.\n\nTo see all configuration options, invoke `kubectl-explore orphans -h`.\nDefault context and namespace found in `$KUBECONFIG` is used, unless specified otherwise.\n\n```shell\nkubectl explore orphans\n```\n\n```\nSearching for unused ConfigMaps and Secrets in the 'default' namespace\nconfigmaps:\n- test\nsecrets: []\n```\n\n### Standalone\nPre-compiled `x86_64-unknown-linux-gnu` binaries are available. Compiling and running [\"from the source\"](#optional-compiling-and-running-from-source) is also an option.\n\n```shell\n\u003e kubectl-explore orphans -h\n```\n\n```\nOptions:\n  -k, --kubeconfig \u003cPATH_TO_KUBECONFIG\u003e\n          Path to a KUBECONFIG file. When not set, env is used.\n  -n, --namespace \u003cNAMESPACE\u003e\n          Namespace to search in.\n  -o, --output \u003cOUTPUT\u003e\n          Output format. YAML by default. [default: yaml] [possible values: yaml, json]\n  -h, --help\n          Print help\n```\n\nE.g. `kubectl-explore -k /etc/rancher/k3s/k3s.yaml -n default -o json` to explicitly specify the `KUBECONFIG` and the namespace.\nIf `KUBECONFIG` is not specified, the `KUBECONFIG` env variable is looked for. When not found, an error is thrown.\nIf `namespace` is not defined, the default namespace from `KUBECONFIG` is used.\n\nFor a list of all commands and general help, invoke `kubectl-explore -h`.\n\n\n\n#### (Optional) compiling and running from source\n1. [Install Rust](https://www.rust-lang.org/learn/get-started)\n1. Simply invoke `cargo run -- -h` (add the `--release` flag for optimal performance) to obtain instructions.\n\n`\u003e cargo run -- -h`\n\n## Testing\n\nRun tests using `cargo test`. Tests require:\n\n1. Running Kubernetes cluster with supported API version `1_26`,\n1. `KUBECONFIG` environment variable set.\n\nAn easy way to obtain a Kubernetes cluster is [k3s.io](https://k3s.io/) - curl -sfL https://get.k3s.io | sh -. After\ninstallation, `export KUBECONFIG=/etc/rancher/k3s/k3s.yaml` and make sure to `chown` or `chmod` the `$KUBECONFIG` file\nfor current user to be able to read it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpscheidl%2Fkubectl-explorer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpscheidl%2Fkubectl-explorer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpscheidl%2Fkubectl-explorer/lists"}