-
Notifications
You must be signed in to change notification settings - Fork 226
Add signal-reboot #814
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
Add signal-reboot #814
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
31101fe
feat: sentinel-command without nsenter by default
ckotzbauer 0fdcd6b
fix: no readonly mount
ckotzbauer db33b8e
fix: mount at different folder
ckotzbauer 5a58a73
feat: add signal-reboot
ckotzbauer 431e466
feat: make signal configurable and add tests
ckotzbauer 38529aa
build: rename job
ckotzbauer e663b14
cleanup: linter
ckotzbauer 128b9e0
build: also adjust signal manifest
ckotzbauer 301474d
test: add e2e-tests
ckotzbauer 267870e
fix: small code restructure
ckotzbauer 544a287
fix: adjust version-range
ckotzbauer 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
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,100 @@ | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: kured | ||
| namespace: kube-system | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: DaemonSet | ||
| metadata: | ||
| name: kured # Must match `--ds-name` | ||
| namespace: kube-system # Must match `--ds-namespace` | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| name: kured | ||
| updateStrategy: | ||
| type: RollingUpdate | ||
| template: | ||
| metadata: | ||
| labels: | ||
| name: kured | ||
| spec: | ||
| serviceAccountName: kured | ||
| tolerations: | ||
| - key: node-role.kubernetes.io/control-plane | ||
| effect: NoSchedule | ||
| - key: node-role.kubernetes.io/master | ||
| effect: NoSchedule | ||
| hostPID: true # Facilitate entering the host mount namespace via init | ||
| restartPolicy: Always | ||
| volumes: | ||
| - name: sentinel | ||
| hostPath: | ||
| path: /var/run | ||
| type: Directory | ||
| containers: | ||
| - name: kured | ||
| # If you find yourself here wondering why there is no | ||
| # :latest tag on Docker Hub,see the FAQ in the README | ||
| image: ghcr.io/kubereboot/kured:1.13.2 | ||
| imagePullPolicy: IfNotPresent | ||
| securityContext: | ||
| privileged: false # Give permission to nsenter /proc/1/ns/mnt | ||
| readOnlyRootFilesystem: true | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: ["*"] | ||
| add: ["CAP_KILL"] | ||
| ports: | ||
| - containerPort: 8080 | ||
| name: metrics | ||
| env: | ||
| # Pass in the name of the node on which this pod is scheduled | ||
| # for use with drain/uncordon operations and lock acquisition | ||
| - name: KURED_NODE_ID | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: spec.nodeName | ||
| volumeMounts: | ||
| - mountPath: /sentinel | ||
| name: sentinel | ||
| readOnly: true | ||
| command: | ||
| - /usr/bin/kured | ||
| - --reboot-sentinel=/sentinel/reboot-required | ||
| - --reboot-method=signal | ||
| # - --reboot-signal=39 | ||
| # - --force-reboot=false | ||
| # - --drain-grace-period=-1 | ||
| # - --skip-wait-for-delete-timeout=0 | ||
| # - --drain-timeout=0 | ||
| # - --period=1h | ||
| # - --ds-namespace=kube-system | ||
| # - --ds-name=kured | ||
| # - --lock-annotation=weave.works/kured-node-lock | ||
| # - --lock-ttl=0 | ||
| # - --prometheus-url=http://prometheus.monitoring.svc.cluster.local | ||
| # - --alert-filter-regexp=^RebootRequired$ | ||
| # - --alert-firing-only=false | ||
| # - --prefer-no-schedule-taint="" | ||
| # - --reboot-sentinel-command="" | ||
| # - --slack-hook-url=https://hooks.slack.com/... | ||
| # - --slack-username=prod | ||
| # - --slack-channel=alerting | ||
| # - --notify-url="" # See also shoutrrr url format | ||
| # - --message-template-drain=Draining node %s | ||
| # - --message-template-reboot=Rebooting node %s | ||
| # - --message-template-uncordon=Node %s rebooted & uncordoned successfully! | ||
| # - --blocking-pod-selector=runtime=long,cost=expensive | ||
| # - --blocking-pod-selector=name=temperamental | ||
| # - --blocking-pod-selector=... | ||
| # - --reboot-days=sun,mon,tue,wed,thu,fri,sat | ||
| # - --reboot-delay=90s | ||
| # - --start-time=0:00 | ||
| # - --end-time=23:59:59 | ||
| # - --time-zone=UTC | ||
| # - --annotate-nodes=false | ||
| # - --lock-release-delay=30m | ||
| # - --log-format=text |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to be sigRtminPlus5 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I fix the typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the typo is still there? But otherwise this should be finally good to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't catch that. Let's fix the typo. If we're going to use camel case I'd vote for:
sigRTMinMaybe:
And we should probably change the
MethodSignalcomment so that it doesn't imply that SIGRTMIN+5 is static (it's just a default, but the user can use whatever number within the min-max range that their OS allows). Maybe: