Search code examples
kuberneteskubernetes-podkubernetes-container

Increase startup threshold for k8s container in v1.12


Following the documentation here, I could set the threshold for container startup like so:

startupProbe:
  httpGet:
    path: /healthz
    port: liveness-port
  failureThreshold: 30
  periodSeconds: 10

Unfortunately, it seems like startupProbe.failureThreshold is not compatible with our current k8s version (1.12.1):

unknown field "startupProbe" in io.k8s.api.core.v1.Container; if you choose to ignore these errors, turn validation off with --validate=false

Is there a workaround for this? I'd like to give a container a chance of ~40+ minutes to start.


Solution

  • Yes, startupProbe was introduced with 1.16 - so you cannot use it with Kubernetes 1.12.

    I am guessing you are defining a livenessProbe - so the easiest way to get around your problem is to remove the livenessProbe. Most applications won't need one (some won't even need a readinessProbe). See also this excellent article: Liveness Probes are Dangerous.