adjust policy for dns

This commit is contained in:
2026-01-17 20:33:50 -05:00
parent f4e0053b56
commit 03f99cae2e
2 changed files with 38 additions and 13 deletions
+14 -7
View File
@@ -11,21 +11,20 @@ spec:
- Egress - Egress
ingress: ingress:
### Allow intra-namespace communication
- from: - from:
- namespaceSelector: - namespaceSelector:
matchLabels: matchLabels:
kubernetes.io/metadata.name: irc kubernetes.io/metadata.name: irc
###
### Allow traffic from gateways
- from: - from:
- namespaceSelector: - namespaceSelector:
matchLabels: matchLabels:
kubernetes.io/metadata.name: istio-system kubernetes.io/metadata.name: istio-system
###
egress: egress:
- to: ### Allow DNS resolution
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: irc
- to: - to:
- namespaceSelector: - namespaceSelector:
matchLabels: matchLabels:
@@ -38,7 +37,14 @@ spec:
port: 53 port: 53
- protocol: TCP - protocol: TCP
port: 53 port: 53
###
### Allow intra-namespace communication
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: irc
###
### Allow outbound to the world
- to: - to:
- ipBlock: - ipBlock:
cidr: 0.0.0.0/0 cidr: 0.0.0.0/0
@@ -46,3 +52,4 @@ spec:
- 10.0.0.0/8 - 10.0.0.0/8
- 172.16.0.0/12 - 172.16.0.0/12
- 192.168.0.0/16 - 192.168.0.0/16
###
+22 -4
View File
@@ -11,23 +11,40 @@ spec:
- Egress - Egress
ingress: ingress:
### Allow intra-namespace communication
- from: - from:
- namespaceSelector: - namespaceSelector:
matchLabels: matchLabels:
kubernetes.io/metadata.name: irc kubernetes.io/metadata.name: irc
###
### Allow traffic from gateways
- from: - from:
- namespaceSelector: - namespaceSelector:
matchLabels: matchLabels:
kubernetes.io/metadata.name: istio-system kubernetes.io/metadata.name: istio-system
###
egress: egress:
# namespace-local ### Allow DNS resolution
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- protocol: UDP
port: 53
- protocol: TCP
port: 53
###
### Allow intra-namespace communication
- to: - to:
- namespaceSelector: - namespaceSelector:
matchLabels: matchLabels:
kubernetes.io/metadata.name: irc kubernetes.io/metadata.name: irc
###
# public internet only ### Allow outbound to the world
- to: - to:
- ipBlock: - ipBlock:
cidr: 0.0.0.0/0 cidr: 0.0.0.0/0
@@ -35,3 +52,4 @@ spec:
- 10.0.0.0/8 - 10.0.0.0/8
- 172.16.0.0/12 - 172.16.0.0/12
- 192.168.0.0/16 - 192.168.0.0/16
###