百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
K

kor

> 云原生
开源

一个 Golang 工具,用于发现未使用的 Kubernetes 资源

1.8K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个 Golang 工具,用于发现未使用的 Kubernetes 资源

Kor - Kubernetes Orphaned Resources Finder

Kor is a tool to discover unused Kubernetes resources. Currently, Kor can identify and list unused:

  • ConfigMaps
  • Secrets
  • Services
  • ServiceAccounts
  • Deployments
  • StatefulSets
  • Roles
  • ClusterRoles
  • ClusterRoleBindings
  • HPAs
  • PVCs
  • Ingresses
  • PDBs
  • CRDs
  • PVs
  • Pods
  • Jobs
  • ReplicaSets
  • DaemonSets
  • StorageClasses
  • NetworkPolicies
  • RoleBindings
  • VolumeAttachments
  • PriorityClasses

Looking for cost analysis and multi-cluster management? Check out KorPro, our cloud-based platform built on top of Kor.

Installation

Download the binary for your operating system from the releases page and add it to your system's PATH.

Homebrew

For macOS users, you can install Kor using Homebrew:

brew install kor

Build from development branch

Install the binary to your $GOBIN or $GOPATH/bin:

go install github.com/yonahd/kor@latest

Build from source

Build the locally cloned source code:

go build main.go

Docker

Run a container with your kubeconfig mounted:

docker run --rm -i yonahdissen/kor

docker run --rm -i -v "/path/to/.kube/config:/root/.kube/config" yonahdissen/kor all

Kubectl plugin ()

kubectl krew install kor

Helm

helm repo add kor https://yonahd.github.io/kor

Run as a cronjob in your Cluster (with an option for sending slack updates)

helm upgrade -i kor \
    --namespace kor \
    --create-namespace \
    --set cronJob.enabled=true
    ./charts/kor

Run as a deployment in your Cluster exposing prometheus metrics

helm upgrade -i kor \
    --namespace kor \
    --create-namespace \
    ./charts/kor

For more information see in cluster usage

Usage

Kor provides various subcommands to identify and list unused resources. The available commands are:

  • all - Gets all unused resources for the specified namespace or all namespaces.
  • configmap - Gets unused ConfigMaps for the specified namespace or all namespaces.
  • secret - Gets unused Secrets for the specified namespace or all namespaces.
  • service - Gets unused Services for the specified namespace or all namespaces.
  • serviceaccount - Gets unused ServiceAccounts for the specified namespace or all namespaces.
  • deployment - Gets unused Deployments for the specified namespace or all namespaces.
  • statefulset - Gets unused StatefulSets for the specified namespace or all namespaces.
  • role - Gets unused Roles for the specified namespace or all namespaces.
  • clusterrole - Gets unused ClusterRoles for the specified namespace or all namespaces (namespace refers to RoleBinding).
  • clusterrolebinding - Gets unused ClusterRoleBindings in the cluster (non namespaced resource).
  • rolebinding - Gets unused RoleBindings for the specified namespace or all namespaces.
  • hpa - Gets unused HPAs for the specified namespace or all namespaces.
  • pod - Gets unused Pods for the specified namespace or all namespaces.
  • pvc - Gets unused PVCs for the specified namespace or all namespaces.
  • pv - Gets unused PVs in the cluster (non namespaced resource).
  • storageclass - Gets unused StorageClasses in the cluster (non namespaced resource).
  • ingress - Gets unused Ingresses for the specified namespace or all namespaces.
  • pdb - Gets unused PDBs for the specified namespace or all namespaces.
  • crd - Gets unused CRDs in the cluster (non namespaced resource).
  • job - Gets unused jobs for the specified namespace or all namespaces.
  • replicaset - Gets unused replicaSets for the specified namespace or all namespaces.
  • daemonset- Gets unused DaemonSets for the specified namespace or all namespaces.
  • volumeattachment - Gets unused VolumeAttachments in the cluster (non-namespaced resource).
  • priorityclass - Gets unused PriorityClasses in the cluster (non-namespaced resource).
  • finalizer - Gets unused pending deletion resources for the specified namespace or all namespaces.
  • networkpolicy - Gets unused NetworkPolicies for the specified namespace or all namespaces.
  • exporter - Export Prometheus metrics.
  • version - Print kor version information.

Supported Flags

…

To use a specific subcommand, run kor [subcommand] [flags].

kor all --include-namespaces my-namespace

For more information about each subcommand and its available flags, you can use the --help flag.

kor [subcommand] --help

Supported resources and limitations

Resource What it looks for Known False Positives ⚠️
ConfigMaps ConfigMaps not used in the following places:
- Pods
- Containers
- ConfigMaps used through Volumes
- ConfigMaps used through environment variables
ConfigMaps used by resources which don't explicitly state them in the config.
e.g Grafana dashboards loaded dynamically OPA policies fluentd configs CRD configs
CRDs CRDs not used the cluster
ClusterRoleBindings ClusterRoleBindings referencing invalid ClusterRole or ServiceAccounts
ClusterRoles ClusterRoles not used in RoleBinding or ClusterRoleBinding
ClusterRoles not used in ClusterRole aggregation
DaemonSets DaemonSets not scheduled on any nodes
Deployments Deployments with no replicas
HPAs HPAs not used in Deployments
HPAs not used in StatefulSets
Ingresses Ingresses not pointing at any Service
Jobs Jobs status is completed
Jobs status is suspended
Jobs failed with backoff limit exceeded (including indexed jobs)
Jobs failed with dedaline exceeded
NetworkPolicies NetworkPolicies with no Pods selected by podSelector or Ingress / Egress rules
PDBs PDBs not used in Deployments / StatefulSets (templates) or in arbitrary Pods
PDBs with empty selectors (match every pod) but no running pods in namespace
Pods Pods in Failed phase with reason Evicted (i.e., evicted pods)
Pods in Crashloopbackoff
PVs PVs not bound to a PVC
PVCs PVCs not used in Pods
PriorityClasses PriorityClasses not used by any Pods
ReplicaSets ReplicaSets that specify replicas to 0 and has already completed it's work
RoleBindings RoleBindings referencing invalid Role, ClusterRole, or ServiceAccounts

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gogogolangk8skubernetes

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类云原生
定价开源

> 相关工具

K
Kubernetes
容器编排事实标准
H
Helm
Kubernetes 包管理器
S
seaweedfs
SeaweedFS is a distributed storage system for object storage (S3), file systems, and Iceberg tables,