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

docs: add sentinel command example for RHEL family #504

Merged
merged 2 commits into from
Mar 3, 2022
Merged

docs: add sentinel command example for RHEL family #504

merged 2 commits into from
Mar 3, 2022

Conversation

khuedoan
Copy link
Contributor

@khuedoan khuedoan commented Feb 23, 2022

Add example for RHEL.

Fixes #498


```yaml
configuration:
rebootSentinelCommand: sh -c "! needs-restarting --reboothint"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has there been thorough testing that this works without escaping quotes? This is definitely valid yaml, but the dispatch of this string includes a few stops along the way until it gets to the actual host OS as a command string, wanna make sure we're good here.

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Helm still creates the same output YAML with or without quotes:

# ...
          command:
            - /usr/bin/kured
          args:
            - --ds-name=release-name-kured
            - --ds-namespace=default
            - --reboot-sentinel-command=sh -c "! needs-restarting --reboothint"
            - --reboot-command=/bin/systemctl reboot
            - --log-format=text
# ...

I've tested both in my homelab

Copy link
Collaborator

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@chadswen
Copy link

chadswen commented Feb 24, 2022

Looks great. This will save people some trial and error time.

Not to derail, but has anyone else tried something like --reboot-sentinel-command=sh -c "[ -f /var/run/reboot-required ] || ( [ -x /usr/bin/needs-restarting ] && ! needs-restarting -r )" to support clusters with a mix of both Red Hat and Debian family nodes? Would that be worth including here for better compatibility?

@khuedoan
Copy link
Contributor Author

I don't have a cluster with mixed distros so I can't test that, therefore it won't be included in this PR, but in theory it should work.

@ghost
Copy link

ghost commented Mar 3, 2022

while i single quoted the string for safety the command worked perfectly for me on fedora 35

@ckotzbauer ckotzbauer merged commit 580279f into kubereboot:main Mar 3, 2022
@khuedoan khuedoan deleted the patch-1 branch March 3, 2022 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enterprise Linux Sentinel Command seems bugged.
4 participants