Pod ready before container finishes starting jetty server

5/1/2018

I have a container that will start a jetty server. It takes about 1 minutes to start The Pod says it is started even tho the server is still starting.

Is there a way to wait until for the container to finish starting before the pod says it is ready?

I tried adding a readiness probe but it fails because the server has not started

"readinessProbe": {
  "httpGet": {
    "path": "/api/health",
    "port": 8080,
    "scheme": "HTTP"
  },
-- Decrypter
kubectl
kubernetes

1 Answer

5/1/2018

Use initialDelaySeconds attribute in readinessProbe as explained at https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-readiness-probes

for example, add 60 seconds delay before you run first test

initialDelaySeconds: 60

-- Prateek Jain
Source: StackOverflow