2

I am using k8s to deploy my docker apps.

Once app is stated it took 20-30s to be ready, app is huge it took some time while booting.

Boot average time is 20-30s. I would like to wait for 60s during the rolling update. Because for now, old pod is terminated while booting new app (in new pod).

How can I do it?

nirebam368
  • 245
  • 4
  • 11
  • Have you [configured a readiness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) for your pod? The old pod shouldn't get torn down until the new pod is ready (and the probe passes). – David Maze Oct 19 '20 at 12:13

1 Answers1

1

Configure readiness probe and startup probe in the pod spec with a failureThreshold * periodSeconds long enough to cover the worse case startup time.As an example.

ports:
- name: readiness-port
  containerPort: 8080
  hostPort: 8080

readinessProbe:
  httpGet:
    path: /healthz
    port: readiness-port
  failureThreshold: 1
  periodSeconds: 10

startupProbe:
  httpGet:
    path: /healthz
    port: readiness-port
  failureThreshold: 30
  periodSeconds: 10
Arghya Sadhu
  • 41,002
  • 9
  • 78
  • 107
  • Ok. so `/healthz` is some endpoint from my app and its called every 10second (and it will fail in 30) when response code is 200 its signal for k8s that my app is ready? – nirebam368 Oct 19 '20 at 12:19