Kor is an open-source tool designed to discover unused resources in a Kubernetes cluster. It helps administrators and developers optimize infrastructure by removing “orphaned” objects that are no longer used but still consume resources and complicate management.
Project repository: github.com/yonahd/kor
Why You Need Kor
Over time, a Kubernetes cluster may accumulate many unused objects — for example:
- ConfigMap or Secret not linked to any pod;
- Service without active endpoints;
- Deployment that hasn’t been run for a long time;
- PersistentVolumeClaim not attached to any pod.
Such resources:
- create load on the API server,
- increase storage and monitoring costs,
- make it harder to maintain clarity and transparency of configurations.
Kor automates the discovery of such objects, simplifying cluster maintenance and improving efficiency.
How Kor Works
Kor connects to your Kubernetes cluster using a kubeconfig file and analyzes resource metadata. The tool maps relationships between resources — for example, checking which ConfigMaps are used by running pods and which PersistentVolumeClaims are mounted.
The result is a detailed report that shows:
- which resources are unused,
- in which namespace they are located,
- which object types can be safely removed.
Example Usage
You can install Kor via go install or by downloading a binary from the GitHub repository:
After installation, simply specify your cluster context:
Kor will scan the specified context and display a list of unused resources:
Namespace: default
ConfigMap: unused-config
Secret: old-credentials
You can also configure filters and output parameters, for example:
Advantages of Using Kor
- Automated analysis of relationships between resources
- Clear recommendations for cluster cleanup
- Compatibility with any Kubernetes distribution
- Simple installation and CLI interface
- Infrastructure and cost optimization
Conclusion
Kor is a valuable tool for DevOps engineers and Kubernetes administrators who want to keep their clusters clean and efficient. It helps identify and remove unused resources, reducing load and improving environment manageability.
FAQ
- Can I use Kor in production?
Yes, Kor is safe for production use as it only reads data from the Kubernetes API and does not make any changes to the cluster. However, it’s recommended to manually review the report before deleting any objects. - Does Kor support all resource types?
Currently, Kor analyzes the most common Kubernetes resources such as ConfigMap, Secret, Service, Deployment, and PersistentVolumeClaim. The full list of supported types can be found in the project documentation. - Do I need to install Kor inside the cluster?
No, Kor works externally via your local kubeconfig. This means you can run it from any machine that has access to the Kubernetes API server. - Can I integrate Kor into a CI/CD pipeline?
Yes, Kor can be integrated into automated pipelines to regularly check cluster state and clean up unused resources. - Does Kor support multiple Kubernetes contexts?
Yes, you can specify the desired context using the --context flag, which is convenient when working with multiple clusters.