Skip to content

Instantly share code, notes, and snippets.

@guilhem
Last active March 27, 2025 16:25
Show Gist options
  • Save guilhem/bda9daad2490d6701eead6208756fbb9 to your computer and use it in GitHub Desktop.
Save guilhem/bda9daad2490d6701eead6208756fbb9 to your computer and use it in GitHub Desktop.
flowchart for Kubernetes Node Shutdown

Kubernetes Node Shutdown

flowchart TD
    subgraph Node
    P((Node: Ready))
    P --> A[Node Shutdown]
    A --> B{Is graceful? not a kernel panic}
    B -->|Yes| C{node graceful enabled?}
    C -->|Yes| H@{ shape: processes, label: "evict pods" }
    C -->|Yes| I@{ shape: processes, label: "NodeUnstageVolume" }
    H --> J[shutdown]
    I --> J
    I --> L
    J --> D
    C -->|No| D{Has CCM?}
    B -->|No| D
    D -->|Yes| E[CCM mark node shutdown with tait]
    D -->|No| F[Node controller mark node shutdown after timeout]
    E --> Q((Node: Unknown))
    F --> Q
    Q --> G@{ shape: processes, label: "Node controller: evict pods"}
    Q --> K{Node is out of service?}
    K -->|Yes| L[ControllerUnpublishVolume]
    end
    subgraph Pod
    R((Pod: Ready))
    R --> S((Pod: Terminating))
    H --> S
    G --> S
    S --> V{POD: has PV with attachement?}
    V -->|No| W[Deleted]
    V -->|Yes| X[Wait Volume: Detached]
    X --> W
    end
    subgraph Volume
    T((Volume: Attached))
    T --> U((Volume: Detached))
    U --> X
    L --> U
    end
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment