2

I have two containers in my Pod (one main app container and another one is just a simple nginx reverse proxy)

      containers:
      - name: my-app
      - name: my-nginx
        lifecycle:
          preStop:
            exec:
              command: ["/bin/sleep", "30"]
      terminationGracePeriodSeconds: 40

and preStop hook to make sure app still has some time to finish received requests while the pod is being terminated.

My question is: will Kubernetes terminate my-app container first completely ignoring preStop hook on the my-nginx container? And if so what should I do to deal with this issue? Add same hook to both containers?

Is there any other way to deal with zero-downtime rolling deployments? (To make sure no request is lost during the redeploy)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.