wired behavior of failureThreshold value

6/24/2019

I am facing a strange issue with failureThreshold value for a pod. Here is the particular block of problem:

readinessProbe:
  enabled: true
  httpPort: 12987
  initialDelaySeconds: 10
  periodSeconds: 30
  timeoutSeconds: 10
  failureThreshold: 1

if its value is 1 then container starts successfully but if its value is 2 then it keeps on restarting. Does anyone has clue, why this is happening?

We are on k8s version: v1.12.3-1+fee411aca93f0e

Same configuration runs fine in other (dev) kubernetes cluster so, I can assume its not a code issue.

-- Prateek Jain
kubernetes

1 Answer

6/26/2019

Change selector httpPort to port.

Defaults value of failureThreshold is to 3. Minimum value is 1. So it is natural that your containers will be restarted beacuse you increased this value.

Take notice that value initialDelaySeconds is the same in your case as timeoutSeconds. Try to increase initialDelaySeconds.

-- MaggieO
Source: StackOverflow