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

[kube-prometheus-stack] Uses ServiceMonitors for kube-system components instead of PodMonitors #4541

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

Comments

@PryceA
Copy link

PryceA commented May 15, 2024

Is your feature request related to a problem ?

The way that scrape configurations are created for things like kubeControllerManager and coreDns uses a ServiceMonitor. This of course requires that a service be created for these which in-turn requires a change in the kube-system namespace. If instead a PodMonitor is used then the deployment can be limited to only the namespace specified.

This is desirable to limit the scope of changes made to a single namespace.

Describe the solution you'd like.

Ideally a deployment would not make any changes outside the specified namesapce (eg. monitoring) and certainly not in kube-system.
By using PodMonitor instead of ServiceMonitor there is less dependency on what is deployed in kube-system.

Describe alternatives you've considered.

Disable these scrape configs and re-implement them as PodMonitors in our values.yaml.

Additional context.

Examples of services made just so ServiceMonitor can be used:




@PryceA PryceA added the enhancement New feature or request label May 15, 2024
@PryceA
Copy link
Author

PryceA commented May 15, 2024

One challenge I ran into when re-implementing them in PodMonitors was that the job label shifted to include the namespace it was deployed to. For example monitoring/coredns instead of just coredns. Not a big deal on its own, but there are lots of built-in dashboards that include a job label filter. So there are some subtle differences between ServiceMonitor and PodMonitor.

@zeritti zeritti changed the title kube-prometheus-stack Uses ServiceMonitors for kube-system components instead of PodMonitors [kube-prometheus-stack] Uses ServiceMonitors for kube-system components instead of PodMonitors May 25, 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

1 participant