about summary refs log tree commit diff
diff options
context:
space:
mode:
authormakefunstuff <[email protected]>2024-06-28 21:19:56 +0200
committermakefunstuff <[email protected]>2024-06-28 21:19:56 +0200
commit70c535f34fb71645ab0f31392430060645ebeeec (patch)
tree86c0215b6295694994130abdedceaf6bc01a160d
parent4bff2f07a17b4e597eff0faa27ad351aa3d6504f (diff)
downloadk3s-lab-70c535f34fb71645ab0f31392430060645ebeeec.tar.gz
allow ingress to grafana
-rw-r--r--tools/monitoring/templates/network-policy.yaml27
1 files changed, 24 insertions, 3 deletions
diff --git a/tools/monitoring/templates/network-policy.yaml b/tools/monitoring/templates/network-policy.yaml
index c7696cb..9e8bd65 100644
--- a/tools/monitoring/templates/network-policy.yaml
+++ b/tools/monitoring/templates/network-policy.yaml
@@ -11,7 +11,28 @@ spec:
   ingress:
   - from:
     - podSelector: {}
-  egress:
-  - to:
-    - podSelector: {}
+  - from:
+    - namespaceSelector:
+        matchLabels:
+          name: monitoring
+---
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+  name: allow-ingress-to-grafana
+  namespace: monitoring
+spec:
+  podSelector:
+    matchLabels:
+      app.kubernetes.io/name: grafana
+  ingress:
+  - from:
+    - namespaceSelector:
+        matchLabels:
+          name: kube-system
+    - podSelector:
+        matchLabels:
+          app: traefik
+  policyTypes:
+  - Ingress