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

OZG-3880 network- policy add dns egress role for user-manager

parent 143e7841
Branches
Tags
No related merge requests found
...@@ -15,8 +15,7 @@ spec: ...@@ -15,8 +15,7 @@ spec:
- ports: - ports:
- port: 8080 - port: 8080
{{- with (.Values.networkPolicy).additionalIngressConfig }} {{- with (.Values.networkPolicy).additionalIngressConfig }}
- from: {{ toYaml . | indent 2 }}
{{ toYaml . | indent 8 }}
{{- end }} {{- end }}
egress: egress:
- to: - to:
...@@ -43,4 +42,15 @@ spec: ...@@ -43,4 +42,15 @@ spec:
protocol: UDP protocol: UDP
- port: 5353 - port: 5353
protocol: TCP protocol: TCP
- to:
- podSelector:
matchLabels:
component: user-manager
ports:
- port: 9000
protocol: TCP
{{- with (.Values.networkPolicy).additionalEgressConfig }}
{{ toYaml . | indent 2 }}
{{- end }}
{{- end }} {{- end }}
\ No newline at end of file
...@@ -91,26 +91,51 @@ tests: ...@@ -91,26 +91,51 @@ tests:
protocol: UDP protocol: UDP
- port: 5353 - port: 5353
protocol: TCP protocol: TCP
- to:
- podSelector:
matchLabels:
component: user-manager
ports:
- port: 9000
protocol: TCP
- it: add ingress rule by values - it: add ingress rule by values
set: set:
networkPolicy: networkPolicy:
ssoPublicIp: 1.1.1.1 ssoPublicIp: 51.89.117.53/32
dnsServerNamespace: kube-system dnsServerNamespace: test-namespace-dns
additionalIngressConfig: additionalIngressConfig:
- from:
- podSelector: - podSelector:
matchLabels: matchLabels:
component: client2 component: client2
asserts: asserts:
- equal: - contains:
path: spec.ingress path: spec.ingress
value: content:
- ports: from:
- port: 8080
- from:
- podSelector: - podSelector:
matchLabels: matchLabels:
component: client2 component: client2
- it: add egress rules by values
set:
networkPolicy:
ssoPublicIp: 51.89.117.53/32
dnsServerNamespace: test-dns-namespace
additionalEgressConfig:
- to:
- ipBlock:
cidr: 1.2.3.4/32
asserts:
- contains:
path: spec.egress
content:
to:
- ipBlock:
cidr: 1.2.3.4/32
- it: test network policy disabled - it: test network policy disabled
set: set:
networkPolicy: networkPolicy:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment