[Helm] retina-hubble v1.3.3 ServiceMonitor uses the wrong Service selector and port
Describe the bug
In the retina-hubble Helm chart v1.3.3, enabling hubble.metrics.serviceMonitor.enabled creates a ServiceMonitor whose label selector and named port do not match the network-observability Service. As a result, Prometheus cannot discover the Service’s Hubble metrics endpoint through this ServiceMonitor.
To Reproduce
- Render the ServiceMonitor and metrics Service. The issue can be reproduced locally without a Kubernetes cluster.
helm template retina oci://ghcr.io/microsoft/retina/charts/retina-hubble \
--version v1.3.3 \
--namespace retina \
--set hubble.metrics.serviceMonitor.enabled=true \
--set prometheus.serviceMonitor.namespace=monitoring \
--show-only templates/hubble/servicemonitor.yaml \
--show-only templates/hubble/metrics-service.yaml
- Compare the ServiceMonitor’s spec.selector.matchLabels with the Service’s metadata.labels. The ServiceMonitor selects k8s-app: hubble, but the Service has k8s-app: networkobservability.
- Compare the ServiceMonitor’s spec.endpoints[0].port with the Service’s spec.ports. The ServiceMonitor references hubble-metrics, but the Service exposes port 9965 under the name hubble.
Expected behavior
The generated ServiceMonitor should select the network-observability Service in the retina namespace and scrape /metrics on its named hubble port.
Screenshots
N/A.
Platform (please complete the following information):
- Retina Version: v1.3.3 (retina-hubble Helm chart)
Additional context
The ServiceMonitor’s namespaceSelector correctly targets retina. Enabling the ServiceMonitor also removes the prometheus.io/scrape and prometheus.io/port annotations from the metrics Service, so annotation-based discovery no longer covers this endpoint.
Let me know if you want me to create a pull request, currently doing a workaround for this with a separate servicemonitor but would like this fixed upstream :)
@JohnMaddison Please go ahead and create PR