-
-
Notifications
You must be signed in to change notification settings - Fork 12
Add concepts guide on graceful shutdown #468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
= Graceful shutdown | ||
|
||
The article https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-terminating-with-grace[Kubernetes best practices: terminating with grace] describes how a graceful shutdown works in Kubernetes. | ||
|
||
Our operators add the needed shutdown mechanism for their products that support graceful shutdown. | ||
|
||
They also configure a sensible amount of time Pods are granted to properly shut down without disrupting the availability of the product. | ||
If you are not satisfied with the default values, you can set the graceful shutdown timeout as follows: | ||
|
||
[source,yaml] | ||
---- | ||
spec: | ||
workers: | ||
config: | ||
gracefulShutdownTimeout: 1h # Set it for all worker roleGroups | ||
roleGroups: | ||
normal: # Will use 1h from the worker role config | ||
replicas: 1 | ||
long: # Will use 6h from the roleGroup config below | ||
replicas: 1 | ||
config: | ||
gracefulShutdownTimeout: 6h # Set it only for this specific roleGroup | ||
---- | ||
|
||
The individual default timeouts are documented in the specific operators at the `Operations -> Graceful shutdown` usage-guide. | ||
adwk67 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
== Kubernetes cluster requirements | ||
Pods need to have the ability to take as long as they need to gracefully shut down without getting killed. | ||
|
||
Imagine the situation that you set the graceful shutdown period to 24 hours. | ||
In the case of e.g. an on-premise Kubernetes cluster the Kubernetes infrastructure team may want to drain the Kubernetes node so that they can do regular maintenance, such as rebooting the node. | ||
They will have some upper limit on how long they will wait for Pods on the Node to terminate before they reboot the Kubernetes node, regardless of any Pods that are still running. | ||
|
||
When setting up a production cluster, you need to check with your Kubernetes administrator (or cloud provider) what time period your Pods have to terminate gracefully. | ||
It is not sufficient to have a look at the `spec.terminationGracePeriodSeconds` and come to the conclusion that the Pods have e.g. 24 hours to gracefully shut down, as e.g. an administrator can reboot the Kubernetes node before the time period is reached. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.