Study FAQ
How do I apply VKS NetworkPolicy without breaking DNS or required traffic?
Also asked as 2
- What should I allow before enabling default-deny NetworkPolicy in VKS?
- How can I test Kubernetes NetworkPolicy and DNS access in a VKS workload namespace?
Answer
In a VKS workload cluster on VCF 9.0, first verify that the installed CNI enforces networking.k8s.io/v1 NetworkPolicy. Map the required traffic for the selected Pods, including the actual cluster DNS path, before applying default-deny ingress or egress.
Start with a representative namespace and label set. Create explicit allowances for the required peer namespaces, Pod labels and ports. Allow the resolver used by those Pods on its required transport and ports. DNS commonly uses both UDP and TCP on port 53, but the correct policy peers depend on how the cluster implements DNS. If the sender and receiver are both isolated, the source egress and destination ingress policies must both allow the connection.
Policies that apply to a Pod combine their allowed traffic. An additional deny-by-default policy leaves existing allowances in place. Verify permitted and denied connections from Pods selected by the new policy, including resolving internal and external names and reaching the required services. Keep a rollback path to the previous reviewed policy if a required flow fails.
Official references
Full explanation
How Load Balancing, Ingress, Egress, CNI, and Service Mesh Work in VKS
Study guide · 3V0-24.25
Read the full explanation