Gateway and placement

  • Worker-local gateway exposure, replica placement, capacity overlap and controlled drain.
100%

Kubernetes · Local/Cluster Service alternatives; terminating-endpoint support stable since 1.28

Node A · receives the external connectionNode BRolling update · placement and drain are separate controlsLocal gateway reachability depends on placement and bounded drainRequest / responseControl / stateFailure / rejectionarrive at ALocal · eligibleLocal · none eligibleCluster · remote allowedgateway routegateway routeschedule + startpermitted scale-downbounded shutdownThis example reaches a NodePort or LoadBalancer Service on Node A. A load balancer must observe the selected node health; Kubernetes cannot force every external device to stop sending instantly.External clientexternalTrafficPolicy: Local selects eligible local endpoints on the receiving node; Cluster permits endpoints on other nodes. For Local, an eligible remote Pod alone cannot rescue a node with no eligible local endpoint. Internal traffic policy is a separate setting.External trafficpolicyThe external Service selects this gateway replica when it is eligible on Node A. The gateway then makes its own upstream application selection. Local external policy does not force its subsequent upstream hop to remain node-local.Local gatewayPodWithout an eligible local endpoint, Local policy does not reroute this new connection to Node B. The terminating-endpoint fallback is version/implementation dependent: kube-proxy supports the documented serving-terminating drain case when every local endpoint is terminating.No eligiblelocal endpointCluster traffic policy can select this eligible gateway on Node B from a connection received on Node A. This is an alternative selection, not a mandatory second gateway hop after the local Pod.Remote gatewayPodThe selected gateway routes to an eligible application backend according to its own route and endpoint view. Gateway availability and application-backend availability are different conditions.ApplicationbackendReplica count alone does not ensure one gateway per externally exposed node. Specify the intended scheduling/placement contract. Topology spread and affinity constrain placement; CPU/memory requests affect scheduler feasibility and rollout headroom.Spread andresource requestsDeployment maxSurge and maxUnavailable bound rollout progress; this conceptual handoff is not a universal rule that every new Pod must become Ready before any old Pod can terminate. These settings do not provide a per-node local-endpoint guarantee. A Ready candidate in one topology domain does not make another exposed node locally serviceable.Rolloutavailability budgetEndpoint withdrawal, external load-balancer observation and local shutdown proceed asynchronously. Existing connections and accepted work require an application/proxy drain contract; they do not migrate merely because readiness changed.Stop new workdrain accepted workKubelet runs the configured preStop hook within the termination grace period and then signals the container process. Allow for hook time and actual shutdown. Work surviving the grace deadline can be forcibly terminated; termination does not prove successful completion.Grace periodthen terminationarrive at ALocal · eligibleLocal · none eligibleCluster · remoteallowedgateway routegateway routeschedule + startpermitted scale-downbounded shutdown

Select a component to trace its direct connections. Drag to pan · Ctrl + wheel or pinch to zoom.

  • With externalTrafficPolicy set to Local, a node receiving external Service traffic can forward it only to an eligible local endpoint. Cluster policy also permits a gateway on another node.
  • During rollout, a gateway needs time to finish accepted work while the external load balancer updates its node membership. The termination grace period bounds the time available for that drain.
Worker-local gateway exposure

Worker-local gateway exposure

  • A DaemonSet provides a gateway workload on each eligible worker.
  • externalTrafficPolicy Local selects local ready endpoints and has its own health-check scope.
  • A LoadBalancer Service and retained NodePorts require a compatible external integration to reconcile appliance membership.
Placement, drain and overlap

Placement, drain and overlap

  • Replica placement, per-node budgets and temporary release generations all consume capacity.
  • Cordon and drain do not by themselves complete external traffic drain or terminate a DaemonSet gateway.