-
Notifications
You must be signed in to change notification settings - Fork 6
Document MachinePool Health #137
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
Open
friegger
wants to merge
3
commits into
main
Choose a base branch
from
enh/ironcore-1472-add-machine-pool-health-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+155
−0
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| # MachinePool Health | ||
|
|
||
| ::: info Since ironcore v0.5.0 | ||
| The `MachinePool` heartbeat and `Ready` condition mechanism described on this page was introduced in | ||
| ironcore v0.5.0. | ||
| ::: | ||
|
|
||
| To determine the availability and health of a `MachinePool`, IronCore implements a heartbeat and status | ||
| condition mechanism modeled after the Kubernetes node heartbeat design. It allows operators, the scheduler, | ||
| and higher-level automation to tell at a glance whether a `MachinePool` and its `machinepoollet` are able to | ||
| serve workloads — without having to probe the pool by trial and error. | ||
|
|
||
| The mechanism is specified in [IEP-15: Pool Health](https://github.com/ironcore-dev/enhancements/blob/main/ieps/15-pool-health.md) | ||
| and involves two parties: | ||
| 1. **The `machinepoollet`**, which regularly reports its health by renewing a `Lease` object and by | ||
| propagating a `Ready` condition onto the `MachinePool`'s `.status.conditions`. | ||
| 2. **The `MachinePool` lifecycle controller** in the IronCore control plane (`ironcore-controller-manager`), | ||
| which watches the `MachinePool`s and their leases and marks a pool's `Ready` condition as `Unknown` if the | ||
| `machinepoollet` stops reporting. | ||
|
|
||
| ::: info | ||
| Health reporting is currently only implemented for `MachinePool`. The `VolumePool` and `BucketPool` types | ||
| are not covered by this mechanism. | ||
| ::: | ||
|
|
||
| ## Heartbeating via Leases | ||
|
|
||
| For every `MachinePool`, the `machinepoollet` acquires and keeps a | ||
| [`coordination.k8s.io/v1 Lease`](https://kubernetes.io/docs/concepts/architecture/leases/) named after the | ||
| pool in the `ironcore-machinepool-lease` namespace. For example, for a `MachinePool` named `my-machinepool`: | ||
|
|
||
| ```yaml | ||
| apiVersion: coordination.k8s.io/v1 | ||
| kind: Lease | ||
| metadata: | ||
| name: my-machinepool | ||
| namespace: ironcore-machinepool-lease | ||
| spec: | ||
| holderIdentity: my-machinepool_0c8914f7-0f35-440e-8676-7844977d3a05 | ||
| leaseDurationSeconds: 40 | ||
| renewTime: "2026-05-01T13:18:48.065888Z" | ||
| ``` | ||
|
|
||
| The `machinepoollet` renews this lease on every heartbeat tick. The `holderIdentity` is unique per poollet | ||
| process (`<pool-name>_<uuid>`), so a restarted poollet transparently takes over the lease from its stale | ||
| predecessor. The lease does not by itself decide pool health — it is one of the two signals the lifecycle | ||
| controller observes (see below). | ||
|
|
||
| ## The `Ready` Condition | ||
|
|
||
| In addition to the lease, the `machinepoollet` regularly reflects the result of an | ||
| [IRI `Status`](/iaas/architecture/runtime-interface) probe into the `MachinePool`'s `.status.conditions` as a | ||
| condition of type `Ready`: | ||
|
|
||
| - `Ready=True` — the last IRI `Status` probe succeeded; the machine runtime is reachable and the pool is | ||
| ready to serve workloads: | ||
|
|
||
| ```yaml | ||
| status: | ||
| conditions: | ||
| - type: Ready | ||
| status: "True" | ||
| reason: HeartbeatReceived | ||
| message: machine runtime status probe succeeded | ||
| observedGeneration: 4 | ||
| lastTransitionTime: "2026-05-01T13:18:48.065888Z" | ||
| ``` | ||
|
|
||
| - `Ready=False` — the IRI `Status` probe failed; the `machinepoollet` is alive (it still renews its lease), | ||
| but the underlying machine runtime is unreachable: | ||
|
|
||
| ```yaml | ||
| status: | ||
| conditions: | ||
| - type: Ready | ||
| status: "False" | ||
| reason: RuntimeUnreachable | ||
| message: <error returned by the machine runtime> | ||
| observedGeneration: 4 | ||
| lastTransitionTime: "2026-05-01T13:18:48.065888Z" | ||
| ``` | ||
|
|
||
| - `Ready=Unknown` — set by the control-plane lifecycle controller when the `machinepoollet` has stopped | ||
| reporting altogether (see the next section): | ||
|
|
||
| ```yaml | ||
| status: | ||
| conditions: | ||
| - type: Ready | ||
| status: Unknown | ||
| reason: MachinePoolStatusUnknown | ||
| message: machinepoollet stopped posting machine pool status. | ||
| observedGeneration: 4 | ||
| lastTransitionTime: "2026-05-01T13:18:48.065888Z" | ||
| ``` | ||
|
|
||
| Inside the `machinepoollet`, a dedicated heartbeat runnable performs the IRI `Status` probe and the lease | ||
| renewal on a fixed interval, while the pool reconciler remains the single writer of the pool's status. | ||
| Whenever the probe result changes, the heartbeat nudges the reconciler via an event so the `Ready` condition | ||
| is updated promptly without waiting for an unrelated reconcile trigger. Condition updates only happen on | ||
| actual changes, so a steady-state pool does not cause continuous status writes. | ||
|
|
||
| The one exception to reconciler-only status writes is the `MachinePool` lifecycle controller in the | ||
| `ironcore-controller-manager`: when it judges a pool unresponsive, it patches `Ready=Unknown` directly (see | ||
| next section). | ||
|
|
||
| ## Detecting Unresponsive MachinePools | ||
|
|
||
| The `MachinePoolLifecycle` controller in the `ironcore-controller-manager` monitors all `MachinePool` objects | ||
| and their leases. A pool is considered *making progress* if either its lease was renewed or its `Ready` | ||
| condition changed since the last observation. If no progress has been detected for longer than a configurable | ||
| grace period, the controller marks the pool's `Ready` condition as `Unknown` with the reason | ||
| `MachinePoolStatusUnknown`. | ||
|
|
||
| The controller deliberately **does not inspect timestamps** of leases or conditions, as comparing timestamps | ||
| is prone to failure due to clock skew between the poollet host and the control plane. Instead, it tracks the | ||
| point in time at which it last *observed a change* and reacts only when no change has been seen for the whole | ||
| grace period. When the `machinepoollet` recovers and renews its lease or updates its condition again, the | ||
| lifecycle controller detects the change and the poollet resumes publishing `Ready=True`/`False`. | ||
|
|
||
| This mirrors the Kubernetes node lifecycle controller behavior and provides the foundation for subsequent | ||
| features like pool rolling and workload eviction, which rely on accurate pool health information. | ||
|
|
||
| ::: warning | ||
| The IronCore scheduler currently does **not** consider the `Ready` condition when placing `Machine`s on a `MachinePool`. | ||
| Workloads can therefore still be assigned to an unhealthy pool, where they remain unprocessed until the `machinepoollet` recovers. | ||
| ::: | ||
|
|
||
| ## Configuration and Defaults | ||
|
|
||
| The default timing parameters follow the Kubernetes kubelet and node controller defaults: | ||
|
|
||
| | Component | Flag | Default | Description | | ||
| |-------------------------------|-----------------------------------------|---------|-----------------------------------------------------------------------------------------------| | ||
| | `machinepoollet` | `--heartbeat-interval` | `10s` | Interval between heartbeats (lease renewal + IRI `Status` probe). | | ||
| | `machinepoollet` | `--heartbeat-lease-duration` | `40s` | `leaseDurationSeconds` published on the pool's lease. Must be greater than the heartbeat interval. | | ||
| | `machinepoollet` | `--heartbeat-status-timeout` | `5s` | Timeout for the IRI `Status` probe. Must be smaller than the heartbeat interval. | | ||
| | `ironcore-controller-manager` | `--machine-pool-lifecycle-grace-period` | `50s` | Time without any observed lease or condition change before a pool's `Ready` condition is marked `Unknown`. | | ||
|
|
||
| For these timers to work correctly, the lease duration must exceed the heartbeat interval, and the lifecycle | ||
| grace period should comfortably exceed the lease duration, so that a few missed heartbeats do not immediately | ||
| mark a pool as unresponsive. | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.