From f3795e6272b938bf0651a82a64012d8c6151d48f Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Thu, 29 Aug 2024 12:25:29 +0200 Subject: [PATCH] OZG-6254 OZG-6484 pvog routing add network policy for vorgang-manager in other namespaces --- src/main/helm/templates/network_policy.yaml | 8 ++++++ src/test/helm/network_policy_test.yaml | 26 +++++++++++++++++-- .../main/helm/templates/network_policy.yaml | 8 ++++++ .../src/test/helm/network_policy_test.yaml | 26 +++++++++++++++++-- 4 files changed, 64 insertions(+), 4 deletions(-) diff --git a/src/main/helm/templates/network_policy.yaml b/src/main/helm/templates/network_policy.yaml index 3a2045292..1f2f9e15f 100644 --- a/src/main/helm/templates/network_policy.yaml +++ b/src/main/helm/templates/network_policy.yaml @@ -71,6 +71,14 @@ spec: ports: - port: 9090 protocol: TCP + - to: + - namespaceSelector: {} + podSelector: + matchLabels: + component: vorgang-manager + ports: + - port: 9090 + protocol: TCP {{- end }} {{- end }} \ No newline at end of file diff --git a/src/test/helm/network_policy_test.yaml b/src/test/helm/network_policy_test.yaml index 94e663a87..9ef5c98f7 100644 --- a/src/test/helm/network_policy_test.yaml +++ b/src/test/helm/network_policy_test.yaml @@ -126,7 +126,7 @@ tests: count: 1 - - it: should add zufi rule when zufi-routing is enabled + - it: should add zufi rules when zufi-routing is enabled set: networkPolicy: dnsServerNamespace: test-dns-server-namespace @@ -148,6 +148,17 @@ tests: ports: - port: 9090 protocol: TCP + - contains: + path: spec.egress + content: + to: + - namespaceSelector: {} + podSelector: + matchLabels: + component: vorgang-manager + ports: + - port: 9090 + protocol: TCP - it: should throw error when zufi is enabled but zufi namespace not set set: @@ -176,4 +187,15 @@ tests: kubernetes.io/metadata.name: zufi-namespace podSelector: matchLabels: - component: zufi-server \ No newline at end of file + component: zufi-server + - notContains: + path: spec.egress + content: + to: + - namespaceSelector: {} + podSelector: + matchLabels: + component: vorgang-manager + ports: + - port: 9090 + protocol: TCP \ No newline at end of file diff --git a/xta-adapter/src/main/helm/templates/network_policy.yaml b/xta-adapter/src/main/helm/templates/network_policy.yaml index c1864c568..ff1ebff54 100644 --- a/xta-adapter/src/main/helm/templates/network_policy.yaml +++ b/xta-adapter/src/main/helm/templates/network_policy.yaml @@ -78,6 +78,14 @@ spec: ports: - port: 9090 protocol: TCP + - to: + - namespaceSelector: {} + podSelector: + matchLabels: + component: vorgang-manager + ports: + - port: 9090 + protocol: TCP {{- end }} {{- with (.Values.networkPolicy).additionalEgressConfigLocal }} diff --git a/xta-adapter/src/test/helm/network_policy_test.yaml b/xta-adapter/src/test/helm/network_policy_test.yaml index 290ac0f70..863e8c70f 100644 --- a/xta-adapter/src/test/helm/network_policy_test.yaml +++ b/xta-adapter/src/test/helm/network_policy_test.yaml @@ -164,7 +164,7 @@ tests: - hasDocuments: count: 1 - - it: should add zufi rule when zufi-routing is enabled + - it: should add zufi rules when zufi-routing is enabled set: networkPolicy: dnsServerNamespace: test-dns-server-namespace @@ -186,7 +186,18 @@ tests: ports: - port: 9090 protocol: TCP - + - contains: + path: spec.egress + content: + to: + - namespaceSelector: {} + podSelector: + matchLabels: + component: vorgang-manager + ports: + - port: 9090 + protocol: TCP + - it: should throw error when zufi is enabled but zufi namespace not set set: networkPolicy: @@ -215,3 +226,14 @@ tests: podSelector: matchLabels: component: zufi-server + - notContains: + path: spec.egress + content: + to: + - namespaceSelector: {} + podSelector: + matchLabels: + component: vorgang-manager + ports: + - port: 9090 + protocol: TCP -- GitLab