about summary refs log tree commit diff
diff options
context:
space:
mode:
authormakefunstuff <[email protected]>2024-06-28 22:15:30 +0200
committermakefunstuff <[email protected]>2024-06-28 22:15:30 +0200
commite95b623f74dd5a3ec06686bc52a4027f6ea06be2 (patch)
treec3b308157861fe660bd42dd8ff02154454b3c8f9
parent855f27b71dc18eb74e32f6d7a302c60691c2a0b9 (diff)
downloadk3s-lab-e95b623f74dd5a3ec06686bc52a4027f6ea06be2.tar.gz
accept prometheus traffic from grafana
Diffstat (limited to '')
-rw-r--r--tools/prometheus/templates/network-policy.yaml21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/prometheus/templates/network-policy.yaml b/tools/prometheus/templates/network-policy.yaml
new file mode 100644
index 0000000..981d050
--- /dev/null
+++ b/tools/prometheus/templates/network-policy.yaml
@@ -0,0 +1,21 @@
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+  name: allow-grafana-to-prometheus
+  namespace: monitoring
+spec:
+  podSelector:
+    matchLabels:
+      app.kubernetes.io/name: prometheus
+  policyTypes:
+    - Ingress
+  ingress:
+    - from:
+        - podSelector:
+            matchLabels:
+              app.kubernetes.io/name: grafana
+      ports:
+        - protocol: TCP
+          port: 9090
+        - protocol: TCP
+          port: 80