Skip to content

Commit 4f0b455

Browse files
authored
fix(monitoring): allow parca Prometheus to reach parca-analytics' Thanos pods (#477)
Confirmed: "Error scraping target: Get \"http://100.64.2.7:9090/metrics\": context deadline exceeded" — Cilium's default-deny was silently dropping scrape traffic from the parca Prometheus into parca-analytics's namespace, timing out rather than refusing. Its serviceMonitorSelector/ serviceMonitorNamespaceSelector are wide open, so it was already discovering the thanos-query/thanos-sidecar/thanos-store ServiceMonitors there; it just couldn't reach the pods. Adds a matching ingress rule to each of the three NetworkPolicies (thanos-query, thanos-store, and the prometheus-parca-analytics pod that hosts the sidecar container) allowing parca's pod on their metrics ports.
1 parent 28e447c commit 4f0b455

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

monitoring/environments/scaleway-parca-demo/main.jsonnet

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,46 @@ local kubeThanos = m.kubeThanos({
3636
}],
3737
ports: [{ port: 'http', protocol: 'TCP' }],
3838
},
39+
{
40+
// Scraped by the parca Prometheus (parca-analytics does not scrape itself).
41+
from: [{
42+
namespaceSelector: { matchLabels: { 'kubernetes.io/metadata.name': 'monitoring' } },
43+
podSelector: {
44+
matchLabels: {
45+
'app.kubernetes.io/component': 'prometheus',
46+
'app.kubernetes.io/instance': 'parca',
47+
'app.kubernetes.io/name': 'prometheus',
48+
'app.kubernetes.io/part-of': 'kube-prometheus',
49+
},
50+
},
51+
}],
52+
ports: [{ port: 'http', protocol: 'TCP' }],
53+
},
3954
],
4055
},
4156
},
4257
},
58+
store+: {
59+
networkPolicy+: {
60+
spec+: {
61+
ingress+: [{
62+
// Scraped by the parca Prometheus (parca-analytics does not scrape itself).
63+
from: [{
64+
namespaceSelector: { matchLabels: { 'kubernetes.io/metadata.name': 'monitoring' } },
65+
podSelector: {
66+
matchLabels: {
67+
'app.kubernetes.io/component': 'prometheus',
68+
'app.kubernetes.io/instance': 'parca',
69+
'app.kubernetes.io/name': 'prometheus',
70+
'app.kubernetes.io/part-of': 'kube-prometheus',
71+
},
72+
},
73+
}],
74+
ports: [{ port: 'http' }],
75+
}],
76+
},
77+
},
78+
},
4379
};
4480

4581
local prometheuses = [
@@ -434,7 +470,9 @@ local prometheuses = [
434470
},
435471
},
436472
}],
437-
ports: [{ port: 'web' }, { port: 'reloader-web' }],
473+
// web/reloader-web are this Prometheus' own metrics; http is the
474+
// Thanos sidecar's, which runs as a container on the same pod.
475+
ports: [{ port: 'web' }, { port: 'reloader-web' }, { port: 'http' }],
438476
}],
439477
},
440478
},

0 commit comments

Comments
 (0)