postfinance / kubenurse

Kubernetes network monitoring
MIT License
407 stars 39 forks source link

introduce feature flags to control checks #54

Closed myaser closed 1 year ago

myaser commented 1 year ago

Running kubenurse at scale (~ 1000 node) can have a negative performance impact on the Kubernetes control plane for example, creating a service for the kubenurse daemonset requires CNI Providers (flannel in my case) to track ALL pods in the iptable rules of all nodes, which will be huge and may lead to increased memory consumption on flannel

Also, neighborhood checks can overload the Kubernetes API server for discovery information.

In addition, I have tools to monitor some stuff that kubenurse covers and I wanted to use only what I need from kubenurse

This PR creates control to disable some of the checks when needed, but does not change the behavior as all checks are enabled by default

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 3328099805


Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/servicecheck/servicecheck.go 17 27 62.96%
<!-- Total: 25 35 71.43% -->
Files with Coverage Reduction New Missed Lines %
internal/kubediscovery/nodewatcher.go 7 81.63%
<!-- Total: 7 -->
Totals Coverage Status
Change from base Build 3323701561: -2.2%
Covered Lines: 433
Relevant Lines: 552

💛 - Coveralls
djboris9 commented 1 year ago

Hi @myaser Thanks for your PR and catching these issues on that scale!

I (or @zbindenren ?) will probably implement these feature flags also on the helm chart later.

zbindenren commented 1 year ago

Hi @myaser Thanks for your PR and catching these issues on that scale!

I (or @zbindenren ?) will probably implement these feature flags also on the helm chart later.

@djboris9 No worries, I will implement this in helm. Making a PR.

myaser commented 1 year ago

@zbindenren & @djboris9 thank you very much :)