hjacobs / kube-janitor

Clean up (delete) Kubernetes resources after a configured TTL (time to live)
GNU General Public License v3.0
473 stars 40 forks source link

Unused PVCs (e.g. EBS volumes): also check for Deployments #70

Closed hjacobs closed 4 years ago

hjacobs commented 4 years ago

Some people run Deployments with volumes. The PVC check should consider this. It's pretty trivial to add a check for Deployments here: https://github.com/hjacobs/kube-janitor/blob/master/kube_janitor/resource_context.py#L19

hjacobs commented 4 years ago

There is a valid use case for using a PVC with a Deployment: a PVC can be backed by a "write many" volume such as AWS EFS. The EFS volume can be mounted by multiple Pods, so a Deployment can be used.