CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Administrator

Service Session Affinity

What a ClusterIP does with repeated requests, what changes when you pin them, what happens when the pinned backend disappears, and the source-IP assumption that makes the whole feature fragile.

Services and Networking Guide 50 of 103 Intermediate

The three-hour default timeout is sessionAffinityConfig.clientIP.timeoutSeconds, read here from the live Service.

Four nodes with three replicas, so a request genuinely can land in three places.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

This guide includes

Use this when repeated requests from one client have to land on the same backend. This matters because a ClusterIP chooses per connection by default, and the affinity that fixes that is keyed on source IP - so it fails the moment anything rewrites the address.

Before you start

  1. Three backends, and how a ClusterIP spreads across them

  2. Pin the client to one backend

  3. What happens when the backend goes away

  4. The limit worth knowing

Official sources