Skip to content

Commit

Permalink
Fix: Sentinel-File behaviour (#70)
Browse files Browse the repository at this point in the history
* fix: reboot-sentinel behaviour

Signed-off-by: Christian Kotzbauer <[email protected]>

* fix: add space

Signed-off-by: Christian Kotzbauer <[email protected]>

---------

Signed-off-by: Christian Kotzbauer <[email protected]>
  • Loading branch information
ckotzbauer authored Jan 20, 2024
1 parent f55c5ff commit b65c52a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/kured/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "1.15.0"
description: A Helm chart for kured
name: kured
version: 5.4.0
version: 5.4.1
home: https://github.com/kubereboot/kured
maintainers:
- name: chopf
Expand Down
2 changes: 1 addition & 1 deletion charts/kured/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The following changes have been made compared to the stable chart:
| `extraEnvVars` | Array of environment variables to pass to the daemonset. | `{}` |
| `metricsHost` | Host to expose the metrics endpoint. | `""` |
| `metricsPort` | Port to expose the metrics endpoint. | `8080` |
| `useRebootSentinelHostPath` | Controls whether the chart uses a hostPath to read the sentinel file. | `true` |
| `configuration.useRebootSentinelHostPath` | Controls whether the chart uses a hostPath to read the sentinel file. | `true` |
| `configuration.lockTtl` | cli-parameter `--lock-ttl` | `0` |
| `configuration.lockReleaseDelay` | cli-parameter `--lock-release-delay` | `0` |
| `configuration.alertFilterRegexp` | cli-parameter `--alert-filter-regexp` | `""` |
Expand Down
12 changes: 6 additions & 6 deletions charts/kured/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ spec:
- --post-reboot-node-labels={{ . }}
{{- end }}
{{- if .Values.configuration.rebootSentinel }}
{{- if .Values.useRebootSentinelHostPath }}
{{- if .Values.configuration.useRebootSentinelHostPath }}
- --reboot-sentinel=/sentinel/{{ base .Values.configuration.rebootSentinel }}
{{ else }}
- --reboot-sentinel={{ .Values.configuration.rebootSentinel }}
{{- end }}
{{- end }}
{{- if and .Values.configuration.rebootSentinelCommand (not .Values.useRebootSentinelHostPath) }}
{{- if and .Values.configuration.rebootSentinelCommand (not .Values.configuration.useRebootSentinelHostPath) }}
- --reboot-sentinel-command={{ .Values.configuration.rebootSentinelCommand }}
{{- end }}
{{- if .Values.configuration.rebootCommand }}
Expand Down Expand Up @@ -197,10 +197,10 @@ spec:
- --{{ $key }}
{{- end }}
{{- end }}
{{- if or .Values.volumeMounts .Values.useRebootSentinelHostPath }}
{{- if or .Values.volumeMounts .Values.configuration.useRebootSentinelHostPath }}
volumeMounts:
{{- end }}
{{- if .Values.useRebootSentinelHostPath }}
{{- if .Values.configuration.useRebootSentinelHostPath }}
- mountPath: /sentinel
name: sentinel
readOnly: true
Expand Down Expand Up @@ -246,10 +246,10 @@ spec:
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- if or .Values.volumes .Values.useRebootSentinelHostPath }}
{{- if or .Values.volumes .Values.configuration.useRebootSentinelHostPath }}
volumes:
{{- end }}
{{- if .Values.useRebootSentinelHostPath }}
{{- if .Values.configuration.useRebootSentinelHostPath }}
- name: sentinel
hostPath:
path: {{ dir .Values.configuration.rebootSentinel }}
Expand Down
4 changes: 2 additions & 2 deletions charts/kured/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ configuration:
skipWaitForDeleteTimeout: "" # when time is greater than zero, skip waiting for the pods whose deletion timestamp is older than N seconds while draining a node (default: 0)
prometheusUrl: "" # Prometheus instance to probe for active alerts
rebootDays: [] # only reboot on these days (default [su,mo,tu,we,th,fr,sa])
rebootSentinel: "" # path to file whose existence signals need to reboot (default "/var/run/reboot-required")
rebootSentinel: "/var/run/reboot-required" # path to file whose existence signals need to reboot (default "/var/run/reboot-required")
rebootSentinelCommand: "" # command for which a successful run signals need to reboot (default ""). If non-empty, sentinel file will be ignored.
rebootCommand: "/bin/systemctl reboot" # command to run when a reboot is required by the sentinel
rebootDelay: "" # add a delay after drain finishes but before the reboot command is issued
Expand Down Expand Up @@ -85,7 +85,7 @@ containerSecurityContext:
readOnlyRootFilesystem: true
# allowPrivilegeEscalation: true # Needed when using defaultAllowPrivilegedEscalation: false in psp

# Use the following security-context when "configuration.rebootMethod=signal and useRebootSentinelHostPath=true"
# Use the following security-context when "configuration.rebootMethod=signal and configuration.useRebootSentinelHostPath=true"
# containerSecurityContext:
# privileged: false
# readOnlyRootFilesystem: true
Expand Down

0 comments on commit b65c52a

Please sign in to comment.