In my Kubernetes cluster, I have a single pod (i.e. one replica) with two containers: server
and cache
.
I also have a Kubernetes Service
that matches my pod.
If cache
is crashing, when I try to send an HTTP request to server
via my Service
, I get a "503 Service Temporarily Unavailable".
The HTTP request is going into the cluster via Nginx Ingress, and I suspect that the problem is that when cache
is crashing, Kubernetes removes my one pod from the Service
load balancers, as promised in the Kubernetes documentation:
The kubelet uses readiness probes to know when a container is ready to start accepting traffic. A Pod is considered ready when all of its containers are ready. One use of this signal is to control which Pods are used as backends for Services. When a Pod is not ready, it is removed from Service load balancers.
I don't prefer this behavior, since I still want to be able server
to respond to requests even if cache
has failed. Is there any way to get this desired behavior?