Skip to content
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

Gracefully stop container before shutdown/reboot #2411

Closed
Krumbelfix opened this issue Jan 28, 2022 · 6 comments
Closed

Gracefully stop container before shutdown/reboot #2411

Krumbelfix opened this issue Jan 28, 2022 · 6 comments

Comments

@Krumbelfix
Copy link

Is your feature request related to a problem? Please describe.
While rebooting our Servers with rke2 we had several times the issue that the containers did not stop properly and therefore the filesystem could not be unmounted. The server hung for several minutes before rebooting.
RKE2_process_hang

Describe the solution you'd like
we implemented the attached systemd unit
systemd-unit.txt

Describe alternatives you've considered
A nice fix to speedup the server reboot provided by rke2 :)

@Martin-Weiss
Copy link

+1

@brandond
Copy link
Member

brandond commented Feb 7, 2022

Linking this in to graceful node shutdown as discussed at k3s-io/k3s#4319 would probably be the proper way to go about this.

@brandond
Copy link
Member

brandond commented Mar 1, 2022

I am not confident that this is something that RKE2 should provide for itself. Both K3s and RKE2 do not - by design - stop workload pods when shutting down. There is some discussion in the linked K3s issue about possible approaches that Harvester (or other users of K3s/RKE2) could take to ensuring that workloads are explicitly terminated as part of systemd shutdown. It could even just be something as simple as installing a service that runs the rke2-killall.sh script on shutdown:

# /etc/systemd/system/rke2-cleanup.service
[Unit]
Description=rke2-cleanup
DefaultDependencies=no
Before=shutdown.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/rke2-killall.sh
TimeoutStartSec=0

[Install]
WantedBy=shutdown.target

Edit: I see that this is the approach that has already been taken by the attached systemd unit. Lets have a discussion about whether or not this is something that should be bundled with RKE2, or if we want to just add it as an example in the documentation.

@Krumbelfix
Copy link
Author

Krumbelfix commented Mar 7, 2022

In my opinion it should be bundled, because it improves the rke experience. It does not have any disadvantages in the daily business and is helps keeping it easy.

@stale
Copy link

stale bot commented Sep 4, 2022

This repository uses a bot to automatically label issues which have not had any activity (commit/comment/label) for 180 days. This helps us manage the community issues better. If the issue is still relevant, please add a comment to the issue so the bot can remove the label and we know it is still valid. If it is no longer relevant (or possibly fixed in the latest release), the bot will automatically close the issue in 14 days. Thank you for your contributions.

@stale stale bot added the status/stale label Sep 4, 2022
@stale stale bot closed this as completed Sep 20, 2022
@alancaldelas
Copy link

Was this actually resolved? I ran the kill-all and now my ceph pods are in unknown state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants