lwolf / kube-cleanup-operator

Kubernetes Operator to automatically delete completed Jobs and their Pods
MIT License
498 stars 109 forks source link

Multi namespace #58

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi,

Is there any way I can specify multiple namespaces where I want to have my jobs/pods cleaned? I dont want all my jobs to be cleaned cluster-wide.

  - args:
    - --namespace=ns1,ns2,ns3

Regards

lwolf commented 4 years ago

I believe the best way to achieve this is to deploy one in each namespace that you need.

ghost commented 4 years ago

I believe the best way to achieve this is to deploy one in each namespace that you need.

Does it mean that I need to apply rbac yaml for each namespace?

lwolf commented 4 years ago

One time will be enough, if you're OK with granting the operator cluster-wide permissions. Otherwise, you need to replace ClusterRole references with the Role and apply it to every namespace you need.