You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Kubernetes or a user deletes a Pod, Kubernetes will notify it and wait for `gracePeriod` seconds before killing it.
185
186
186
-
During that time window (30 seconds by default), the Pod is in the `terminating` state and will be removed from any Services by a controller. The Pod itself needs to catch the `SIGTERM` signal and start failing any readiness probes.
187
+
During that time window (30 seconds by default), the Pod is in the `terminating` state and will be removed from any Services by a controller.
188
+
The Pod itself needs to catch the `SIGTERM` signal and start failing any readiness probes.
187
189
188
190
> If the ingress controller you use route via the Service, it is not an issue for your case. At the time of this writing, we use the nginx ingress controller which routes traffic directly to the Pods.
189
191
190
192
During this time, it is possible that load-balancers (like the nginx ingress controller) don't remove the Pods "in time", and when the Pod dies, it kills live connections.
191
193
192
-
To make sure you don't lose any connections, we recommend delaying the shutdown with the number of milliseconds that's defined by the readiness probe in your deployment configuration. To help with this, terminus exposes an option called `beforeShutdown` that takes any Promise-returning function.
194
+
To make sure you don't lose any connections, we recommend delaying the shutdown with the number of milliseconds that's defined by the readiness probe in your deployment configuration.
195
+
To help with this, terminus exposes an option called `beforeShutdown` that takes any Promise-returning function.
196
+
197
+
Also it makes sense to use the `useExit0 = true` option to signal Kubernetes that the container exited gracefully.
198
+
Otherwise APM's will send you alerts, in some cases.
0 commit comments