Search code examples
kuberneteskubernetes-health-checkkubernetes-service

What happens when a service receives a request but has no ready pods?


Having a kubernetes service (of type ClusterIP) connected to a set of pods, but none of them are currently ready - what will happen to the request? Will it:

  • fail eagerly
  • timeout
  • wait until a ready pod is available (or forever, whichever is earlier)
  • something else?

Solution

  • It will time out.

    Kube-proxy pulls out the IP addresses from healthy pods and sets as endpoints of the service (backends). Also, note that all kube-proxy does is to re-write the iptables when you create, delete or modify a service.

    So, when you send a request within your network and there is no one to reply, your request will timeout.