Skip to content

Commit

Permalink
Reducing time wait for ingress controller shutdown
Browse files Browse the repository at this point in the history
According to https://medium.com/codecademy-engineering/kubernetes-nginx-and-zero-downtime-in-production-2c910c6a5ed8 95 seconds seems like too much for ingress controller preStop shutdown.
  • Loading branch information
RockyMM committed Oct 2, 2023
1 parent 104ca8a commit 45a39ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deployment/helm/ditto/templates/nginx-ingress.yaml
Expand Up @@ -646,7 +646,7 @@ spec:
lifecycle:
preStop:
exec:
command: ["sleep", "95"]
command: ["sleep", "{{ .Values.ingress.controller.preStopWait }}"]
env:
- name: POD_NAME
valueFrom:
Expand Down
4 changes: 4 additions & 0 deletions deployment/helm/ditto/values.yaml
Expand Up @@ -206,6 +206,10 @@ ingress:
# of its containers crashing, for it to be considered available
# ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#min-ready-seconds
minReadySeconds: 10
# as NGINX Ingress Controller on its pod shutdown tends to interrupt connections, we need to include
# some wait time so that existing connections are fully handled before the pod is really shut down.
# ref: https://medium.com/codecademy-engineering/kubernetes-nginx-and-zero-downtime-in-production-2c910c6a5ed8
preStopWait: 15
# specify how many old ReplicaSets for ingress controller deployment will be retained
# ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#clean-up-policy
revisionHistoryLimit: 5
Expand Down

0 comments on commit 45a39ee

Please sign in to comment.