Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper failsafe if EXCLUDED_NAMESPACES could **NOT** be properly parsed. #33

Open
larssb opened this issue May 14, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@larssb
Copy link

larssb commented May 14, 2024

Issue

I wish that the kube-downscaler had a safe fall-back reaction in regards to the case where it cannot properly parse a declared EXCLUDED_NAMESPACES env. var. #25 fixes some issues. By generally making the passed Helm Values excluded namespaces Array be properly parsed.
However, there could still be cases where parsing fails, values in the EXCLUDED_NAMESPACES are off and so forth.

In these cases it is certainly beneficial that the kube-downscaler doesn't just scale everything down on the cluster where on it runs. That's what happens right now if EXCLUDED_NAMESPACES can't be parsed and one have e.g. configured/declared the DEFAULT_UPTIME env. var.

Problem to solve / Proposal

Code logic into the kube-downscaler so that it rejects an EXCLUDED_NAMESPACES env. var it can't parse and then falls back to dry running or throwing errors into stderr so that some log collector could be such log lines up and one to alert on these further down the line,

@Fovty Fovty mentioned this issue May 16, 2024
@samuel-esp
Copy link
Collaborator

samuel-esp commented Aug 14, 2024

I will work on this issue, my proposal is:

  1. we will check the EXCLUDED_NAMESPACES list of regex provided by the user at startup
  2. If we detect a problematic parse we will print a Warning log to help user debugging

We could block the execution entirely if we detect something like this issue #26 but I rather prefer just to inform the user about this potential misconfiguration

Since EXCLUDED_NAMESPACES is a list of regex, it would be difficult to detect misconfiguration other than the one described in issue #26 (which is caused by the fact that namespaces in k8s can't start with a leading space, so it could be a fairly common misconfiguration among other users as well), we'll add for sure more use cases in the future as we identify other potential misconfigurations reported by other users

@samuel-esp samuel-esp added the enhancement New feature or request label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants