about summary refs log tree commit diff
path: root/tools/elasticsearch/templates
diff options
context:
space:
mode:
authormakefunstuff <[email protected]>2024-06-28 23:49:53 +0200
committermakefunstuff <[email protected]>2024-06-28 23:49:53 +0200
commit1a6542620487748132b7c495f73bfafed1a7a0ec (patch)
treefa97a2b2a25073f861fdfa66a6769226b610fb6b /tools/elasticsearch/templates
parentd555bdcec06c258bd1fee3735c7d7b5348632885 (diff)
downloadk3s-lab-1a6542620487748132b7c495f73bfafed1a7a0ec.tar.gz
placement
Diffstat (limited to 'tools/elasticsearch/templates')
-rw-r--r--tools/elasticsearch/templates/network-policy.yaml27
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/elasticsearch/templates/network-policy.yaml b/tools/elasticsearch/templates/network-policy.yaml
new file mode 100644
index 0000000..8665861
--- /dev/null
+++ b/tools/elasticsearch/templates/network-policy.yaml
@@ -0,0 +1,27 @@
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+  name: allow-logstash-and-grafana-to-elasticsearch
+  namespace: monitoring
+spec:
+  podSelector:
+    matchLabels:
+      app.kubernetes.io/name: elasticsearch
+  policyTypes:
+    - Ingress
+  ingress:
+    - from:
+        - podSelector:
+            matchLabels:
+              app.kubernetes.io/name: logstash
+      ports:
+        - protocol: TCP
+          port: 9200
+    - from:
+        - podSelector:
+            matchLabels:
+              app.kubernetes.io/name: grafana
+      ports:
+        - protocol: TCP
+          port: 9200
+