A stable address must lead to ready endpoints
Service and labels
Pods can be recreated with new addresses. A Service provides a stable entry point and selects Pods using a selector. If labels do not match, ready Pods exist, but there are no matching endpoints. For example, the selector app=shop matches Pods with that label. The addresses of selected ready Pods form the endpoints.
Readiness and liveness
Readiness determines whether traffic can be sent to a container. Liveness helps detect a stuck container so it can be restarted. A startup probe protects a slow startup. A failed readiness check alone does not mean a restart.
The first seconds of startup
In the experiment, one of three Pods is not ready for ten seconds. The two ready replicas provide 400 operations/s. If the third is included in uniform load distribution too early, some requests reach an application that is not ready.
External access
ClusterIP is intended for access within the cluster. External HTTP access uses a Gateway implementation with HTTPRoute or an Ingress controller. Here we study only an internal Service; a routing object does not itself start a proxy.
Task
Three Pods serve 400 operations/s, but the first is not ready for ten seconds. Configure Service, selector and readiness so requests reach ready endpoints.
One Pod is not ready for the first 10 s; the others are ready immediately. If the selector does not match, there are no endpoints. Without readiness, each selected Pod receives an equal share of requests, including the unready one. Separate direct Pod access is not a supported solution here.
- Add a Service with a matching selector.
- Configure readiness.
- Compare the first ten seconds with the ready endpoint set.