jsonnet/components/prometheus: Fix thanos-sidecar metrics access (#2330)

When enabled, the thanos-sidecar opens an HTTP listener on port 10902,
which what's used to scrape metrics.  This port wasn't being added to
the Prometheus Service, so wasn't added to the NetworkPolicy causing
scraping to fail from Prometheus instances other than the local one.

This adds the port to the Service and NetworkPolicy.

Fixes: #2006
This commit is contained in:
Brad Ison
2024-01-15 10:16:17 +01:00
committed by GitHub
parent 56b1a48a46
commit 895db2a272

View File

@@ -175,7 +175,10 @@ function(params) {
] +
(
if p._config.thanos != null then
[{ name: 'grpc', port: 10901, targetPort: 10901 }]
[
{ name: 'grpc', port: 10901, targetPort: 10901 },
{ name: 'http', port: 10902, targetPort: 10902 },
]
else []
),
selector: p._config.selectorLabels,