all repos — janny @ 1eb6327f50f8678bcc7d681436933d933eec2ac7

clean up Kubernetes resources after a set TTL

Add CR/Bs and info to readme
Anirudh Oppiliappan x@icyphox.sh
Tue, 09 Mar 2021 08:58:13 +0530
commit

1eb6327f50f8678bcc7d681436933d933eec2ac7

parent

1a0013c3416c766c754e85030a9cdc248e3ae061

3 files changed, 54 insertions(+), 1 deletions(-)

jump to
A deploy/clusterrole.yaml

@@ -0,0 +1,37 @@

+apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: janny +rules: +- apiGroups: + - "" + resources: + - pods + - services + verbs: + - get + - list + - watch + - delete +- apiGroups: + - apps + resources: + - deployments + - daemonsets + - statefulsets + - replicasets + - controllerrevisions + verbs: + - get + - list + - watch + - delete +- apiGroups: + - batch + resources: + - jobs + verbs: + - get + - list + - watch + - delete
A deploy/clusterrolebinding.yaml

@@ -0,0 +1,12 @@

+apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: janny +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: janny +subjects: +- kind: ServiceAccount + name: janny + namespace: default
M readmereadme

@@ -27,7 +27,11 @@ $ docker build -t janny:latest .

Finally, deploy to your cluster: - $ kubectl apply -f deploy/deployment.yaml + $ 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.