All technological notes.
When you deploy pods, they are distributed across the nodes in the cluster.
nodes span different availability zones or regions and the pods deployed on those nodes exchange traffic with each other, network performance and traffic costs can become an issue.svc.spec.internalTrafficPolicy field
local:
pods on a given node is forwarded only to pods on the same node.Topology-Aware Routing (TAR)
nodes must contain the kubernetes.io/zone label to indicate which zone each node is located in.service.kubernetes.io/topology-aware-hints=auto
EndpointSlice object(s)apiVersion: discovery.k8s.io/v1
kind: EndpointSlice
metadata:
name: example-hints
labels:
kubernetes.io/service-name: example-svc
addressType: IPv4
ports:
- name: http
protocol: TCP
port: 80
endpoints:
- addresses:
- "10.1.2.3"
conditions:
ready: true
hostname: pod-1
zone: zone-a
hints: # hint
forZones:
- name: "zone-a"