A NetworkPolicy policy type declares which traffic direction becomes isolated: Ingress for incoming traffic, Egress for outgoing traffic, or both. Policies are additive, so separate objects can control different directions. section 6.6
Use policyTypes to make the intended isolation explicit:
- Ingress isolates incoming traffic; permitted traffic and its reply traffic remain allowed. section 6.6
- Egress isolates outgoing traffic and requires egress rules to define permitted destinations. section 6.6
Allow traffic in both directions
Select nginx with an Ingress policy allowing busybox on TCP port 80, then select busybox with an Egress policy allowing nginx on the same port. Verify the resulting connection with kubectl exec and wget.
