kured (KUbernetes REboot Daemon)

repository·main·Indexed 25 days ago

https://github.com/kubereboot/kured

A Kubernetes DaemonSet that automates safe node reboots by monitoring OS-level reboot requirements. It manages the node lifecycle through cordoning, draining, rebooting, and uncordoning, utilizing API server locking to ensure only one node reboots at a time.

Tokens
480
Snippets
1
Records
5
Agent score
32%

What's inside kured

  1. What is kured (KUbernetes REboot Daemon)?

    main

    kured is a Kubernetes DaemonSet designed to perform safe, automatic node reboots. It triggers reboots when the underlying operating system's package management system indicates a reboot is required.

    Core Functionality:

    • Sentinel Monitoring: Watches for reboot sentinel files (e.g., /var/run/reboot-required) or the successful execution of a sentinel command.
    • Concurrency Control: Uses a lock in the Kubernetes API server to ensure that only one node reboots at a time, preventing cluster-wide downtime.
    • Node Lifecycle Management: Automatically cordons and drains worker nodes before a reboot and uncordons them once the node is back online.
    • Reboot Deferral: Can be configured to defer reboots if active Prometheus alerts are present or if specific selected pods are running.
  2. Use environment variables to configure kured

    main

    kured supports configuring all command line flags via environment variables. The environment variable name is constructed by taking the KURED prefix, followed by the flag name in uppercase, with hyphens replaced by underscores.

    Example mapping:

    • --node-id $\rightarrow$ KURED_NODE_ID
    • --reboot-command $\rightarrow$ KURED_REBOOT_COMMAND
    • --drain-timeout $\rightarrow$ KURED_DRAIN_TIMEOUT
  3. Configure kured via command line flags

    main
    kured is configured using a variety of command line flags. These flags control the reboot behavior, draining process, scheduling, notifications, and metrics. Note that all flags can also be set via environment variables using the KURED_ prefix (e.g., --node-id can be set via KURED_NODE_ID).