Skip to content
Snippets Groups Projects
Commit 779f715f authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6254 OZG-6484 pvog routing add network policy

parent 10452019
No related branches found
No related tags found
No related merge requests found
......@@ -59,4 +59,15 @@ spec:
protocol: UDP
- port: 5353
protocol: TCP
{{- if eq (.Values.routing).routingStrategy "ZUFI" }}
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ required "routing.zufiManager.namespace must be set if antragraum is enabled" ((.Values.routing).zufiManager).namespace }}
podSelector:
matchLabels:
component: zufi-server
{{- end }}
{{- end }}
\ No newline at end of file
......@@ -123,4 +123,54 @@ tests:
dnsServerNamespace: test-dns-server-namespace
asserts:
- hasDocuments:
count: 1
\ No newline at end of file
count: 1
- it: should add zufi rule when zufi-routing is enabled
set:
networkPolicy:
dnsServerNamespace: test-dns-server-namespace
routing:
routingStrategy: ZUFI
zufiManager:
namespace: zufi-namespace
asserts:
- contains:
path: spec.egress
content:
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: zufi-namespace
podSelector:
matchLabels:
component: zufi-server
- it: should throw error when zufi is enabled but zufi namespace not set
set:
networkPolicy:
dnsServerNamespace: test-dns-server-namespace
routing:
routingStrategy: ZUFI
asserts:
- failedTemplate:
errorMessage: routing.zufiManager.namespace must be set if antragraum is enabled
- it: should not add zufi rule when zufi-routing is disabled
set:
networkPolicy:
dnsServerNamespace: test-dns-server-namespace
routing:
zufiManager:
namespace: zufi-namespace
asserts:
- notContains:
path: spec.egress
content:
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: zufi-namespace
podSelector:
matchLabels:
component: zufi-server
\ No newline at end of file
......@@ -66,6 +66,17 @@ spec:
protocol: TCP
- port: 9000
protocol: TCP
{{- if eq (.Values.routing).routingStrategy "ZUFI" }}
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ required "routing.zufiManager.namespace must be set if antragraum is enabled" ((.Values.routing).zufiManager).namespace }}
podSelector:
matchLabels:
component: zufi-server
{{- end }}
{{- with (.Values.networkPolicy).additionalEgressConfigLocal }}
{{ toYaml . | indent 2 }}
{{- end }}
......
......@@ -162,4 +162,53 @@ tests:
dnsServerNamespace: test-dns-server-namespace
asserts:
- hasDocuments:
count: 1
\ No newline at end of file
count: 1
- it: should add zufi rule when zufi-routing is enabled
set:
networkPolicy:
dnsServerNamespace: test-dns-server-namespace
routing:
routingStrategy: ZUFI
zufiManager:
namespace: zufi-namespace
asserts:
- contains:
path: spec.egress
content:
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: zufi-namespace
podSelector:
matchLabels:
component: zufi-server
- it: should throw error when zufi is enabled but zufi namespace not set
set:
networkPolicy:
dnsServerNamespace: test-dns-server-namespace
routing:
routingStrategy: ZUFI
asserts:
- failedTemplate:
errorMessage: routing.zufiManager.namespace must be set if antragraum is enabled
- it: should not add zufi rule when zufi-routing is disabled
set:
networkPolicy:
dnsServerNamespace: test-dns-server-namespace
routing:
zufiManager:
namespace: zufi-namespace
asserts:
- notContains:
path: spec.egress
content:
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: zufi-namespace
podSelector:
matchLabels:
component: zufi-server
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment