Skip to content

About

Kubernetes controller to report to k8s api if the node needs rebooting

Resources

Code of conduct

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Node-reboot-required-reporter

This is code is in early alpha.

Introduction

node-reboot-required-reporter is a k8s daemonset reporting whether a reboot is required for the node with minimum kubernetes access rights:

  • Reading file on the host filesystem, like /run/reboot-required (for Ubuntu/Debian variants)
  • Running a command on the host filesystem (for SUSE, and other OSes)
  • Setting a kured.dev/RebootRequired condition on nodes

It only patches a condition.

When you have an heterogeneous cluster with different OSes, run multiple daemonsets.

Behaviour

The daemonset updates its node's kured.dev/RebootRequired condition on a timer (interval is defined with the period flag. Side note: Do not update the default value without deep knowledge of kured behaviour). It ALWAYS updates the condition's LastHeartbeatTime for its node, whether a transition happened or not.

Flags

  • nodeID (mandatory, default: ""): name of the node managed. Should be passed down from spec.nodeName via KURED_NODE_ID environment variable
  • distribution <ubuntu|suse|custom> (optional, default: "custom") : linux distribution running on the node. Used to select appropriate reboot sentinel. Use 'custom' to use custom reboot sentinel command or file.
  • debug <true|false> (optional, default: false): Display debug events
  • kubeconfig (optional, default: ""): kubeconfig to use instead of using the ds serviceAccount
  • logFormat <text|json> (optional, default: json): format used in logging
  • metricsHost (optional, default: "")
  • metricsPort (optional, default: 8080): port where metrics for reboot required are exposed
  • period (optional, default: 1 minute): period at which the check for reboot detected is run. DO NOT CHANGE IT UNLESS YOU CHANGE ALL KURED PERIODS APPROPRIATELY.
  • rebootSentinelCommand (optional, default: ""): command for which a zero return code will cause the kured.dev/RebootRequired condition to be applied on the node.
  • rebootSentinelFile (optional, default: "/sentinel/reboot-required"): path to file whose existence causes the kured.dev/RebootRequired condition to be applied on the node.

Extra information about lifecycle

When nodeID is not set, the system will crash to highlight the issue.

When distribution is set to something else than custom, there is no need to redefine rebootSentinelCommand/rebootSentinelFile. This is a convenience tool.

The metrics are not considered confidential and therefore will only run on http. Patches are welcomed as long as it does not increase maintenance complexity.

The daemonset is not emitting kubernetes events.

Debugging

The pods logs are the best location for debugging information. Then check the node's conditions. If a node has not been updated since period of time, it means the daemonset is in limbo.

Security and access rights

The controller ServiceAccount must be able to:

  • Run a volume of type hostPath (for sentinel files)
  • Run a HostPID commands (for sentinel host commands)
  • Apply a status change (update, patch) to nodes and read all nodes (get)

This also means the privileges are restricted.

Getting Help

If you have any questions about, feedback for or problems with node-reboot-required-reporter:

We follow the CNCF Code of Conduct.

Your feedback is always welcome!

Trademarks

Kured is a Cloud Native Computing Foundation Sandbox project.

Cloud Native Computing Foundation logo

The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see Trademark Usage.

About

Kubernetes controller to report to k8s api if the node needs rebooting

Resources

Code of conduct

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors