all repos — janny @ c12f502f68fd091311412b452e92d746f026934c

clean up Kubernetes resources after a set TTL

readme (view raw)

 1JANNY
 2
 3A work-in-progress Kubernetes application to clean up Kubernetes
 4resources after a set TTL.
 5
 6
 7ROADMAP
 8
 9[x] Implement basic resource cleaning
10[x] Black/whitelist resources (--included-resources flag)
11[ ] Expiry timestamp
12[ ] Helm chart
13
14USAGE
15
16Two ways to deploy janny: plain Kubernetes manifests or via a Helm
17chart.
18
19Kubernetes manifests
20--------------------
21
221. Modify deploy/deployment.yaml: specify included resources, and
23namespaces for janny to operate on.
24
252. Create a service account
26
27    $ kubectl create sa janny
28
293. Modify deploy/clusterrole.yaml to limit janny's access to resources.
30   Ensure that janny has access to the resources you specified in the
31   deployment.yaml!
32
334. Deploy janny:
34
35    $ kubectl apply -f deploy/
36
37Helm chart
38----------
39
40TODO
41
42
43DEVELOPING
44
45Setup a local minikube cluster[1]. Then, clone this repo and install
46dependencies:
47
48    $ poetry shell
49    $ poetry install
50
51Build a docker image (gets stored in minikube's registry):
52
53    $ eval $(minikube env-docker)
54    $ docker build -t janny:latest .
55
56Finally, deploy to your cluster:
57
58    $ kubectl create sa janny
59    $ kubectl apply -f deploy/
60
61
62PRIOR ART
63
64https://codeberg.org/hjacobs/kube-janitor: While kube-janitor already
65does the same thing, it's written using pykube, which has been
66undeveloped since 2017.
67
68
69[1]: https://minikube.sigs.k8s.io/docs/