CertKeen

Certified Kubernetes Administrator (CKA) · Free practice question 5 of 12

Session affinity by client IP

A legacy app at Calderbrook Florists stores sessions in memory, so each client must keep reaching the same pod behind its ClusterIP Service. Which Service setting does this?

  1. A.clusterIP: None
  2. B.sessionAffinity: ClientIP
  3. C.externalTrafficPolicy: Cluster
  4. D.ipFamilyPolicy: SingleStack
Show answer and explanation

Correct answer: B. sessionAffinity: ClientIP

Why: sessionAffinity: ClientIP makes kube-proxy send connections from the same client IP to the same backend pod, with a configurable timeout. externalTrafficPolicy concerns external traffic routing and source IPs, clusterIP: None makes the Service headless with no proxying, and ipFamilyPolicy chooses IPv4/IPv6 families.

More free Certified Kubernetes Administrator (CKA) questions