- How do Pods find each other inside the cluster? (Service discovery)
- How does external traffic reach your applications? (Ingress / Gateway API)
- How do you control which Pods can talk to which other Pods? (Network security)


- Load balancing: How does a frontend spread traffic across replicas when pod IPs change or replicas scale?
- Discovery: How does a client find backend replicas that might not have existed at the client’s deploy time?
- External access: How do external users reach apps when Pods have private cluster IPs?

- A client Pod calls a service name such as
api-service. - CoreDNS resolves the name to the Service ClusterIP (e.g.,
10.96.50.100). This ClusterIP is virtual and stable for the Service lifetime. - The Service uses a label selector to find backend Pods. As matching Pods appear or disappear, the Service endpoints update.
- Traffic to the ClusterIP is load-balanced to healthy backend Pods by kube-proxy or the CNI dataplane.

Practical guidance: prefer
ClusterIP for internal services and avoid creating many LoadBalancer services (cost and lifecycle management). For HTTP(s) traffic, use a single Ingress controller or Gateway API to centralize routing and reduce cloud load balancer sprawl.
Service load balancing is implemented by kube-proxy on each node or by your chosen CNI dataplane, which distributes connections across the backend Pods.
Ingress solves the multi-load-balancer cost and routing problem. Instead of provisioning one cloud load balancer per Service, you deploy a single Ingress controller (backed by one cloud LB) that routes traffic for multiple Services using host and path rules.
Example Ingress resource:
app.example.com. The Ingress controller watches these resources and configures the reverse-proxy (or cloud LB) to route /api to api-svc and /web to web-svc.

- NGINX Ingress Controller — well established and widely used.
- Envoy-based controllers such as Contour (Envoy dataplane).
- Traefik — popular for dynamic configuration and observability.
- Role separation: infrastructure defines the load balancer type (GatewayClass), platform operators manage Gateway instances and ports, and application teams own HTTPRoute/TCPRoute resources to define routing.
- Enhanced features: traffic splitting (canaries), request mirroring, header-based routing, and native TCP/UDP routing for non-HTTP workloads.
- Better extensibility and security boundaries between infrastructure, ops, and app teams.
- GatewayClass — defines the implementation (managed by infra).
- Gateway — creates a concrete load balancer/listeners (managed by platform operators).
- HTTPRoute / TCPRoute / UDPRoute — define routing rules (managed by application owners).

app: frontend to reach Pods with label app: backend on TCP port 8080:

- Policies are namespace-scoped: a policy in namespace A does not affect namespace B.
- Policies are additive: multiple policies can apply to the same Pod; if any policy allows a connection, it is allowed. NetworkPolicy objects do not include explicit “deny” rules — deny is implicit by omission.
- A Pod is affected only if at least one NetworkPolicy selects it. If no NetworkPolicy selects a Pod, traffic to/from the Pod is allowed by default.
- NetworkPolicies require a CNI plugin that implements them. If your CNI does not support NetworkPolicies, they will be ignored.
NetworkPolicies are effective only if your cluster’s CNI implements them. If the CNI doesn’t support NetworkPolicies, applying them will have no effect (and will not emit an error).
Examples:

Best practices (quick reference):
- Use
ClusterIPServices to hide pod IP churn and provide DNS names. - Prefer a single Ingress controller or Gateway API for external HTTP(s) traffic to reduce cloud LB costs.
- Adopt NetworkPolicies with default deny and explicit allows; confirm CNI support.
- Always prefer DNS names (
api-service,api-service.namespace, or FQDN) over hardcoded pod IPs.

- Kubernetes Services: https://kubernetes.io/docs/concepts/services-networking/service/
- Ingress: https://kubernetes.io/docs/concepts/services-networking/ingress/
- Gateway API: https://gateway-api.sigs.k8s.io/
- NetworkPolicy: https://kubernetes.io/docs/concepts/services-networking/network-policies/
- CoreDNS: https://coredns.io/
- kube-proxy: https://kubernetes.io/docs/concepts/services-networking/kube-proxy/
- CNI: https://www.cni.dev/