hjacobs / kube-janitor

Clean up (delete) Kubernetes resources after a configured TTL (time to live)
GNU General Public License v3.0
472 stars 40 forks source link

Deleting CRDS like EtcdCluster is not working #46

Closed christianhuening closed 4 years ago

christianhuening commented 4 years ago

I am trying to delete CRDs like EtcdCluster via Janitor. Specified like so:

rulesFile:
    rules:
      - id: namespace-cleanup
        resources:
        - deployments
        - services
        - etcdcluster
        jmespath: "!(spec.template.metadata.labels.janitorIgnore)"
        ttl: 12h

it does not delete the etcdcluster resource. This resource is introduced by the Etcd Operator from coreOS. Do I have to specify the CRDs somehow special?

hjacobs commented 4 years ago

Maybe you have a typo? The list of resource types should use the plural form, i.e. "etcdclusters".

christianhuening commented 4 years ago

oh, thanks, will test!

christianhuening commented 4 years ago

didnt seem to fix it. maybe the full name including the api?

christianhuening commented 4 years ago

whoops sorry, only etcd in whitelisted namespaces are left. so, fixed, all good! Thanks!