https://github.com/mgoltzsche/pvc-remover
Kubernetes controllers to remove particular PVCs on Pod completion
https://github.com/mgoltzsche/pvc-remover
Last synced: about 1 year ago
JSON representation
Kubernetes controllers to remove particular PVCs on Pod completion
- Host: GitHub
- URL: https://github.com/mgoltzsche/pvc-remover
- Owner: mgoltzsche
- License: apache-2.0
- Created: 2020-09-21T19:35:04.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-22T22:19:13.000Z (almost 6 years ago)
- Last Synced: 2024-12-28T15:49:39.976Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 49.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/mgoltzsche/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=
```