You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -142,8 +142,9 @@ When `MaxParkedNodes` is set to a non-zero value:
142
142
- For integers: `limit = configured value`
143
143
2.**Count parked nodes**: k8s-shredder counts the number of currently parked nodes
144
144
3.**Calculate available slots**: `availableSlots = limit - currentlyParked`
145
-
4.**Limit parking**: If the number of eligible nodes exceeds available slots, only the first `availableSlots` nodes are parked
146
-
5.**Skip if full**: If no slots are available (currentlyParked >= limit), parking is skipped for that eviction interval
145
+
4.**Sort by age**: Eligible nodes are sorted by creation timestamp (oldest first) to ensure predictable parking order
146
+
5.**Limit parking**: If the number of eligible nodes exceeds available slots, only the oldest `availableSlots` nodes are parked
147
+
6.**Skip if full**: If no slots are available (currentlyParked >= limit), parking is skipped for that eviction interval
147
148
148
149
**Examples:**
149
150
-`MaxParkedNodes: "0"` (default): No limit, all eligible nodes are parked
@@ -156,7 +157,16 @@ When `MaxParkedNodes` is set to a non-zero value:
156
157
-**Proportional safety**: Maintains a consistent percentage of available capacity regardless of cluster size
157
158
-**Auto-scaling friendly**: Works well with cluster auto-scaling by recalculating limits each cycle
158
159
159
-
This limit applies to both Karpenter drift detection and node label detection features. When multiple nodes are eligible for parking but the limit would be exceeded, k8s-shredder will park the nodes in the order they are discovered and skip the remaining nodes until the next eviction interval.
160
+
**Predictable Parking Order:**
161
+
Eligible nodes are **always sorted by creation timestamp (oldest first)**, regardless of whether `MaxParkedNodes` is set. This ensures:
162
+
-**Consistent behavior**: The same nodes will be parked first across multiple eviction cycles
163
+
-**Fair rotation**: Oldest nodes are prioritized for replacement during rolling upgrades
164
+
-**Predictable capacity**: You can anticipate which nodes will be parked next when slots become available
165
+
-**Deterministic ordering**: Even when parking all eligible nodes (no limit), they are processed in a predictable order
166
+
167
+
This sorting behavior applies to both Karpenter drift detection and node label detection features. When multiple nodes are eligible for parking:
168
+
-**With no limit** (`MaxParkedNodes: "0"`): All nodes are parked in order from oldest to newest
169
+
-**With a limit**: Only the oldest nodes up to the limit are parked; newer nodes wait for the next eviction interval
160
170
161
171
**Use cases:**
162
172
-**Gradual node replacement**: Control the pace of node cycling during cluster upgrades
0 commit comments