kubernetes: httpGet in readiness and liveness probes fails on status > 200 and < 400

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/.): No

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): httpGet


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Kubernetes version (use kubectl version):

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"clean", BuildDate:"2017-05-19T20:41:24Z", GoVersion:"go1.8.1", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"clean", BuildDate:"2017-05-19T18:33:17Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Cloud provider or hardware configuration: AWS
  • OS (e.g. from /etc/os-release): PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
  • Kernel (e.g. uname -a): Linux ip-10-44-40-175 4.4.65-k8s #1 SMP Tue May 2 15:48:24 UTC 2017 x86_64 GNU/Linux
  • Install tools: kops
  • Others:

What happened: A readiness probe getting a 302 error code causes the pod to be not be marked Ready. A liveness probe getting a 302 error code causes the pod to be killed.

What you expected to happen: As per the documentation:

Any code greater than or equal to 200 and less than 400 indicates success. Any other code indicates failure.

How to reproduce it (as minimally and precisely as possible): Create a deployment of an app that returns 302 HTTP status code, rather than 200. Add a readiness probe. Watch it fail to mark the pod as ready. Add a liveness probe. Watch it kill the pod.

Anything else we need to know: The expected behaviour is documented in at least two places, https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/ and https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 28 (8 by maintainers)

Most upvoted comments

/reopen

As far as I know, this is still a problem.

On Mon., 5 Mar. 2018, 01:18 k8s-ci-robot, notifications@github.com wrote:

Closed #47893 https://github.com/kubernetes/kubernetes/issues/47893.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kubernetes/kubernetes/issues/47893#event-1502934506, or mute the thread https://github.com/notifications/unsubscribe-auth/ABONYyroAumfXGfMmBiKMzxLDr6Hyfvrks5ta_eZgaJpZM4OB4K3 .