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

      - name: my-app
      - name: my-nginx
              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)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.