Some ServiceMonitors
deployed by the garden operator have label prometheus: seed
instead of prometheus: garden
#11270
Labels
How to categorize this issue?
/area monitoring
/kind bug
What happened:
Some
ServiceMonitors
are deployed with labelprometheus: seed
in the garden cluster by thegardener-operator
. However, thegarden
Prometheus
which is used to collect metrics for components in the garden cluster is configured to selectServiceMonitors
with labelprometheus: garden
. This causes metrics for the corresponding components to not be collected. Additionally, theseServiceMonitors
are deployed with theseed-
prefix in their name instead ofgarden-
:What you expected to happen:
ServiceMonitors
to be deployed with the correct labels so that metrics for the corresponding components can be scraped by thegarden
Prometheus
running in the garden cluster.How to reproduce it (as minimally and precisely as possible):
Garden
ServiceMonitors
above are not created with appropriate labelsprometheus-garden
service usingkubectl -n garden port-forward service/prometheus-garden 9090:80
, open the prometheus UI onhttp://localhost:9090/
and notice that metrics forgardener-resource-manager
,vpa-admission-controller
andvpa-recommender
are missing from the garden prometheus.Anything else we need to know?:
The name and labels used for these
ServiceMonitors
are calculated using the following function:For GRM:
gardener/pkg/component/gardener/resourcemanager/resource_manager.go
Lines 1122 to 1127 in d5d3c63
For garden clusters
TargetDiffersFromSourceCluster
is falseFor
vpa-recommender
andvpa-admission-controller
:gardener/pkg/component/autoscaling/vpa/vpa.go
Lines 320 to 325 in d5d3c63
The cluster type for the garden cluster is
seed
.When the garden cluster is also a seed cluster, GRM and vpa-{recommender,admission-controller} are not deployed as part of the
Seed
reconciliation. However, the seed's prometheus instance is deployed and it will start scraping theseed-gardener-resource-manager
,seed-vpa-admission-controller
andseed-vpa-recommender
ServiceMonitors
that were deployed as part of theGarden
reconciliation.Environment:
kubectl version
):The text was updated successfully, but these errors were encountered: