all repos — janny @ 1eb6327f50f8678bcc7d681436933d933eec2ac7

clean up Kubernetes resources after a set TTL

readme (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
JANNY

A work-in-progress Kubernetes application to clean up Kubernetes
resources after a set TTL.


ROADMAP

[x] Implement basic resource cleaning
[ ] Black/whitelist resources
[ ] Expiry timestamp
[ ] Helm chart


DEVELOPING

Setup a local minikube cluster[1]. Then, clone this repo and install
dependencies:

    $ poetry shell
    $ poetry install

Build a docker image (gets stored in minikube's registry):

    $ eval $(minikube env-docker)
    $ docker build -t janny:latest .

Finally, deploy to your cluster:

    $ kubectl create sa janny
    $ kubectl apply -f deploy/

This will create a ServiceAccount, ClusterRole, ClusterRoleBinding and a
Deployment. Edit to suit your needs.

Note: Absolutely nothing works at the moment, so don't even bother.


PRIOR ART

https://codeberg.org/hjacobs/kube-janitor: While kube-janitor already
does the same thing, it's written using pykube, which has been
undeveloped since 2017.


[1]: https://minikube.sigs.k8s.io/docs/