Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

helm-chart: Support excluding namespaces #83

Merged
merged 1 commit into from
Jan 22, 2020

Conversation

guikcd
Copy link
Contributor

@guikcd guikcd commented Jan 22, 2020

This is interesting to scan all namespaces except a list of specific ones.
Referenced in #66.

Tested with your two sample deployments, in default namespace, and in mytest namespace (default and kube-system untouched, mytest downscaled):

values.yml:

[...]
namespace:
  inactive_in:
    - kube-system
    - default
[...]

pod describe:

[...]
    Args:
      --interval=60
      --exclude-namespaces=kube-system,default
      --debug
[...]

Logs of kube-downscaler itself:

[...]
2020-01-22 10:48:55,419 DEBUG: Resource flask-v1-tutorial was excluded (either resource itself or namespace None are excluded)
2020-01-22 10:48:55,514 DEBUG: Resource flask-v2-tutorial was excluded (either resource itself or namespace None are excluded)
2020-01-22 10:48:55,522 DEBUG: Resource coredns was excluded (either resource itself or namespace None are excluded)
2020-01-22 10:48:55,522 DEBUG: Resource kube-downscaler was excluded (either resource itself or namespace None are excluded)
2020-01-22 10:48:55,522 DEBUG: Resource tiller-deploy was excluded (either resource itself or namespace None are excluded)
2020-01-22 10:48:55,616 DEBUG: Deployment mytest/flask-v1-tutorial has 1 replicas (original: None, uptime: Mon-Fri 07:00-19:00 US/Eastern)
2020-01-22 10:48:55,616 INFO: Deployment mytest/flask-v1-tutorial within grace period (900s), not scaling down (yet)
2020-01-22 10:48:55,716 DEBUG: Deployment mytest/flask-v2-tutorial has 1 replicas (original: None, uptime: Mon-Fri 07:00-19:00 US/Pacific)
2020-01-22 10:48:55,716 INFO: Deployment mytest/flask-v2-tutorial within grace period (900s), not scaling down (yet)

This is interesting to scan all namespaces unless a list of specific ones.
Referenced in hjacobs#66.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.942% when pulling 926141b on guikcd:active_inactive_namespaces into 95af6a5 on hjacobs:master.

@hjacobs hjacobs merged commit f8c2e18 into hjacobs:master Jan 22, 2020
@guikcd guikcd deleted the active_inactive_namespaces branch January 22, 2020 11:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants