stackrox / kube-linter

KubeLinter is a static analysis tool that checks Kubernetes YAML files and Helm charts to ensure the applications represented in them adhere to best practices.

Home Page:https://docs.kubelinter.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEATURE_REQUEST] Checking for dangling serviceMonitors

abrad3 opened this issue · comments

commented

Description of the problem/feature request
A customer asked for me to add a check for dangling serviceMonitors, behaving exactly the same way as the dangling service check.

Description of the existing behavior vs. expected behavior
kubelinter currently does not flag dangling serviceMonitors- i.e. serviceMonitors that do not match any service.
serviceMonitors use the monitoring.coreos.com/v1 apiVersion.
I can provide a full-fledged example of when it should pass or not if necessary.

Additional context
I've implemented this feature already- I'm opening this issue to follow the code of conduct :)
My implementation is at: https://github.com/abrad3/kube-linter/tree/dangling-servicemonitor.

If this sounds good, please let me know and I'll make a PR!

Sounds good! Waiting for a PR

commented

Thanks!
PR: #547