From fd843b45b7f280ce36f37e02e05047974d728199 Mon Sep 17 00:00:00 2001
From: Sergio Gonzalez <sergio.gonzalez.diaz@atos.net>
Date: Tue, 6 Sep 2022 12:53:57 +0200
Subject: [PATCH] Add NetworkPolicy to monitoringservice

---
 manifests/monitoringservice.yaml | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/manifests/monitoringservice.yaml b/manifests/monitoringservice.yaml
index 44b880fa3..f7ebdf7ac 100644
--- a/manifests/monitoringservice.yaml
+++ b/manifests/monitoringservice.yaml
@@ -39,6 +39,9 @@ spec:
         - name: influxdb
           containerPort: 9009
           protocol: TCP
+        - name: postgre
+          containerPort: 8812
+          protocol: TCP
         env:
         - name: QDB_CAIRO_COMMIT_LAG
           value: "1000"
@@ -109,4 +112,30 @@ spec:
   - name: influxdb
     protocol: TCP
     port: 9009
-    targetPort: 9009
\ No newline at end of file
+    targetPort: 9009
+  - name: postgre
+    protocol: TCP
+    port: 8812
+    targetPort: 8812
+
+---
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+  name: access-monitoring
+spec:
+  podSelector:
+    matchLabels:
+      app: monitoringservice 
+  ingress:
+  - from: []
+    ports:
+    - port: 7070
+    - port: 8812
+  - from:
+    - podSelector:
+        matchLabels:
+          app: monitoringservice
+    ports:
+    - port: 9009
+    - port: 9000
-- 
GitLab