From the Kubernetes documentation:
A pod with containers reporting that they are not ready does not receive traffic through Kubernetes Services.
Does this mean that a failing readinessProbe
supposed to prevent incoming traffic from pods within the same deployment? If I set up a readinessProbe
that checks an endpoint which is only available after the pod joined the application cluster, then the endpoint never comes up. I checked manually with netcat, and the port of the not ready pod (which is used to establish cluster membership) is indeed not accessible from the other ready pods of the application cluster.
Is this expected? Any possible workaround for this?
The behavior that you are seeing is expected as it is used to determine if the pod is ready for traffic. In addition, the readiness behavior applies to all incoming traffic and is not limited to inter-pod comms within the same deployment. A suggestion as a workaround is to create separate services for readiness checks as this will not disrupt the traffic flow of your pods.