diff --git a/jsonnet/kube-prometheus/components/prometheus.libsonnet b/jsonnet/kube-prometheus/components/prometheus.libsonnet index 461a4253f0d5c44c75e25939655548f3abb70510..7306849f640a0ee4fd2880ee6a46d16058d7a429 100644 --- a/jsonnet/kube-prometheus/components/prometheus.libsonnet +++ b/jsonnet/kube-prometheus/components/prometheus.libsonnet @@ -116,6 +116,18 @@ function(params) { port: o.port, protocol: 'TCP', }, p.service.spec.ports), + }, { + from: [{ + podSelector: { + matchLabels: { + 'app.kubernetes.io/name': 'grafana', + }, + }, + }], + ports: [{ + port: 9090, + protocol: 'TCP', + }], }], }, }, diff --git a/manifests/prometheus-networkPolicy.yaml b/manifests/prometheus-networkPolicy.yaml index f7a9010da2192e28017c955c1d5f8a1a13a3121a..c2eec26e8918fe43a356deb80e9f8c93371931f6 100644 --- a/manifests/prometheus-networkPolicy.yaml +++ b/manifests/prometheus-networkPolicy.yaml @@ -22,6 +22,13 @@ spec: protocol: TCP - port: 8080 protocol: TCP + - from: + - podSelector: + matchLabels: + app.kubernetes.io/name: grafana + ports: + - port: 9090 + protocol: TCP podSelector: matchLabels: app.kubernetes.io/component: prometheus