Sign inSign up

mgoltzsche/pvc-remover

By mgoltzsche

•Updated about 6 years ago

Kubernetes controller that deletes PersistentVolumeClaims on Pod completion

Image
0

1.9K

mgoltzsche/pvc-remover repository overview

⁠pvc-remover

Kubernetes controllers to remove a PersistentVolumeClaim (PVC) of a particular StorageClass when an associated Pod is completed.

This project's primary purpose is the early deletion of volumes provisioned by cache-provisioner⁠ so that the volume contents can be committed and quickly reused for the next (build) job.

⁠How it works

The Pod controller annotates and deletes matching PVCs (storageClassName, accessMode=ReadWriteOnce) that are associated with a matching, completed Pod (annotations?, labels?, status.phase=Succeeded, restartPolicy=Never).
The PVC controller removes the finalizer kubernetes.io/pvc-protection from PVCs that have a deletion timestamp and the annotation pvc-remover.mgoltzsche.github.com/no-pvc-protection allowing unsafe deletion while still referenced by Pods.

⁠Build

make

⁠Test

Run controller tests:

make test

Test interactively against a real cluster:

make manager
./bin/manager --storage-class=<your-ephemeral-storage-class-name>

Tag summary

Content type

Image

Digest

Size

10.3 MB

Last updated

about 6 years ago

docker pull mgoltzsche/pvc-remover