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

--include-resources not working as expected #10

Closed CookieComputing closed 5 years ago

CookieComputing commented 5 years ago

I've been having issues trying to get --include-resources to work as expected.

I tried two variants of this spec but didn't get anything to work:

spec:
      containers:
      - args:
        - --debug
        - --interval=20
        - --rules-file=/config/rules.yaml
        - --include-resources=deployment
spec:
      containers:
      - args:
        - --debug
        - --interval=20
        - --rules-file=/config/rules.yaml
        - --include-resources=deployment
        - --include-namespaces=default

I ran kubectl run temp-nginx --image=nginx and annotated it with kubectl annotate deploy temp-nginx janitor/ttl=5s, but the deployment doesn't disappear after a loop run. Any ideas on what to do?

CookieComputing commented 5 years ago

That's a bit embarrassing; the issue was deployment instead of deployments. Likewise, it should be pods and not pod.