From 49d1f00dbd5c2cdd840333e9de03b3789f45de0e Mon Sep 17 00:00:00 2001 From: Stanislav Zaprudskiy Date: Wed, 22 Feb 2023 10:40:34 +0100 Subject: [PATCH] Do not keep web container running during termination We could let the web container terminate as usual, as there are no reasons to keep it running as it doesn't participate in job control. Additionally, it stops receiving traffic with the beginning of termination > At the same time as the kubelet is starting graceful shutdown, the > control plane removes that shutting-down Pod from EndpointSlice (and > Endpoints) objects where these represent a Service with a configured > selector @ https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination --- .../templates/deployments/deployment.yaml.j2 | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/roles/installer/templates/deployments/deployment.yaml.j2 b/roles/installer/templates/deployments/deployment.yaml.j2 index 3c5de60f..32670640 100644 --- a/roles/installer/templates/deployments/deployment.yaml.j2 +++ b/roles/installer/templates/deployments/deployment.yaml.j2 @@ -244,18 +244,6 @@ spec: {% endif %} {% if web_extra_volume_mounts -%} {{ web_extra_volume_mounts | indent(width=12, first=True) }} -{% endif %} -{% if termination_grace_period_seconds is defined %} - - name: pre-stop-data - mountPath: /var/lib/pre-stop - - name: pre-stop-scripts - mountPath: /var/lib/pre-stop/scripts - lifecycle: - preStop: - exec: - command: - - bash - - /var/lib/pre-stop/scripts/termination-waiter {% endif %} env: - name: MY_POD_NAMESPACE