Closed rmannibucau closed 1 month ago
@rmannibucau Just to make sure I got it right, you'd want to have some config toggle to enable/disable k0s setting up prometheus.io/scrape:
annotation value?
@jnummelin yes, ideally in k0s.yaml or alike.
I've found prometheus.io/scrape: true
annotation in these components:
I propose to add a boolean configuration under each component called prometheusScrapeAnnotation
which by default will be true (for backwards compatibility).
Example k0s.yaml
:
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
metadata:
name: k0s
spec:
...
coredns:
prometheusScrapeAnnotation: true
konnectivity:
...
prometheusScrapeAnnotation: true
network:
...
kubeProxy:
...
prometheusScrapeAnnotation: true
kuberouter:
...
prometheusScrapeAnnotation: true
WDYT?
Looks perfect to me! Thank you very much.
I'm working on it.
The issue is marked as stale since no activity has been recorded in 30 days
The issue is marked as stale since no activity has been recorded in 30 days
Can we reopen it, guess it is just a bot thing?
The issue is marked as stale since no activity has been recorded in 30 days
Up?
The issue is marked as stale since no activity has been recorded in 30 days
The issue is marked as stale since no activity has been recorded in 30 days
Up
The issue is marked as stale since no activity has been recorded in 30 days
The issue is marked as stale since no activity has been recorded in 30 days
@twz123 can you reopen this issue? The PR is ready to review
The issue is marked as stale since no activity has been recorded in 30 days
The issue is marked as stale since no activity has been recorded in 30 days
The issue is marked as stale since no activity has been recorded in 30 days
The issue is marked as stale since no activity has been recorded in 30 days
Before creating an issue, make sure you've checked the following:
Platform
Version
1.2.26 - but master has it too
Sysinfo
`k0s sysinfo`
What happened?
prometheus annotations enable scraping for kube-system components (https://github.com/k0sproject/k0s/blob/73a8a11d56c8e0c7535f45c22f9739440c12635e/pkg/component/controller/kubeproxy.go#L312), would be great to make it togglable and deactivable for instances where prometheus is not intended for core components, in particular when it does not work out of the box cause the node ip is not accessible to prometheus for ex.
Steps to reproduce
Start k0s (in single node mode for ex) .
Expected behavior
Check annotations of coredns, kube-proxy and kube-router, should get scrape=false for prometheus default setup
Actual behavior
scrape=true
Screenshots and logs
-
Additional context
-