How do you restrict egress from pods to specific external services?
IntermediateProductionKubernetes & Service Networking in Production
Answer
NetworkPolicy with ipBlock for fixed CIDRs, FQDN-aware policies (Cilium toFQDNs, Calico DNS policy), an egress gateway giving a stable source IP, or a proxy or Network Firewall with domain allow-lists. Standard Kubernetes policy cannot filter by hostname.
Stable egress IPs matter when partners allow-list you: use NAT gateway EIPs, or Cilium egress gateway on dedicated nodes.
More on Kubernetes & Service Networking in Production
How do you expose an application on Kubernetes to the internet in production?BeginnerALB IP mode versus instance mode on EKS: which should you use?IntermediateHow do you achieve graceful pod shutdown with no dropped requests?AdvancedHow do readiness, liveness and startup probes interact with traffic?BeginnerHow do you design default-deny NetworkPolicies without breaking DNS?IntermediateHow do you debug "pod cannot reach service" in Kubernetes?Advanced