Repository navigation
Spread CKS nodes of each type across hosts by default - #14763
bhouse-nexthop wants to merge 1 commit into
Conversation
When a node type has no user-chosen affinity group, a new cluster gets a non-strict host anti-affinity group for it, so one host failure doesn't take out the whole control plane or every etcd member. - New account-scoped setting cloud.kubernetes.cluster.default.anti.affinity.enabled (default true) - Non-strict: nodes prefer different hosts; deploy and scale still work with fewer hosts than nodes - Groups: cks-<cluster uuid>-<worker|control|etcd>; control/etcd only with 2+ nodes (they don't scale) - User-chosen groups for a node type win; no default added for it - Stored in the existing node-type affinity map, so scale, add-node and replacement reuse them - Deleted with the cluster unless another cluster or a live VM still uses them - Skipped if the non-strict processor is excluded; existing clusters untouched Signed-off-by: Brad House <bhouse@nexthop.ai>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #14763 +/- ##
===========================================
Coverage 20.80% 20.81%
- Complexity 20919 20942 +23
===========================================
Files 6053 6053
Lines 548451 548513 +62
Branches 78719 73289 -5430
===========================================
+ Hits 114128 114193 +65
+ Misses 420958 420956 -2
+ Partials 13365 13364 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Tested on a KVM lab with three KVM hosts, running a main (24.0) build that includes this change. Primary storage is Ceph RBD. The CKS clusters are Kubernetes 1.34.7, created with no affinity groups given. Result: 12 of 12 checks passed for the spread cluster, 6 of 6 for the control, and the delete checks passed.
The account setting was reset afterwards. A 1 control + 2 worker cluster created earlier on the same build got only a Not tested: scale-up and add-node keeping the group, a user-chosen group for one node type, |
Description
New CKS clusters spread each node type across hosts by default. Builds on the per-node-type affinity groups from #12386.
cloud.kubernetes.cluster.default.anti.affinity.enabled, account scope, defaulttruenon-strict host anti-affinity: nodes prefer different hosts and are never blocked, so fewer hosts than nodes still workscks-<cluster uuid>-<worker|control|etcd>, owned by the cluster ownerNonStrictHostAntiAffinityProcessoris excludedWhy default on: non-strict only changes host ordering in the planner and never fails a deploy. Without it, a single host failure can take out every control node or every etcd member.
Fixes: #14762
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
KubernetesClusterManagerImplTest:KubernetesClusterManagerImplTest,KubernetesClusterActionWorkerTest,KubernetesClusterScaleWorkerTest,KubernetesClusterResourceModifierActionWorkerTest: all passHow did you try to break this feature and the system with this change?
updateKubernetesClusterAffinityGroupsreplaces the map as before; any default groups it drops are still deleted with the cluster