Feature: Enable mixed cluster(BM+VM nodes) #2972
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 473 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.369
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2972"
general
weight: 0.35
pmores
<!--
If this is a bug fix, make sure your description includes "Fixes: #xxxx", or
"Closes: #xxxx"
Please provide the following information:
-->
- Description of the problem which is fixed/What is the use case
OSC today assumes a homogeneous worker node fleet - all bare-metal or all VM. Someone running OpenShift on hybrid infrastructure (some workers on bare metal, others on VMs) cannot safely run sandboxed workloads because RuntimeClasses like
kataandkata-remoteshare the samescheduling.nodeSelector(node-role.kubernetes.io/kata-oc).- What I did
Introduced
EnableMixedClusterinKataConfigSpecto activate per-node-class sandbox scheduling. When enabled:1. The operator deploys a NodeFeatureRule (
osc-node-type) via NFD with fourrules that label worker nodes based on x86 CPUID flags:
- BM nodes:
kataconfiguration.openshift.io/node-type=bare-metal+kata-capable=true- VM nodes:
kataconfiguration.openshift.io/node-type=virtual- Nested-virt Intel VMs (HYPERVISOR + VMX):
kata-capable=true+nested-virt-capable=true- Nested-virt AMD VMs (HYPERVISOR + SVM):
kata-capable=true+nested-virt-capable=true2. RuntimeClass nodeSelectors are updated per node class:
-
katauseskata-capable=true(matches BM nodes + nested-virt VMs)-
kata-cc,kata-nvidia-gpu,kata-cc-nvidia-gpuusenode-type=bare-metal(BM only — TEE/GPU hardware required)-
kata-remoteusesnode-type=virtual(all VM nodes)3. Existing RuntimeClasses on a running cluster are patched when
EnableMixedClusteris toggled on (update path increateRuntimeClass).4. The NodeFeatureRule is removed and RuntimeClass nodeSelectors are reverted when
EnableMixedClusteris toggled off.5. A pre-flight check verifies the NFD Operator is installed before proceeding.
6. Added e2e tests for this feature.
- How to verify it
1. Install NFD Operator and create a
NodeFeatureDiscoveryCR2. Deploy the operator with this change
3. Create a KataConfig with
enableMixedCluster: true4. Verify nodes are labeled:
5. Verify RuntimeClass nodeSelectors include the correct labels:
7. On a VM-only cluster, all nodes should be labeled
virtualandkatapodsshould stay Pending (no
kata-capablenode unless nested virt is available)8. Toggle
enableMixedCluster: falseand verify labels are removed andRuntimeClass nodeSelectors revert
9. Run unit tests:
go test ./controllers/ -run "^Test" -v- Testing
- The operator build with these changes have been tested on a mixed cluster.
- The cluster had a BM node, VM node with nested virt and VM node without nested virt.
- Labeling of nodes and scheduling of pods worked as intended on the mixed node cluster.
- Description for the changelog
Add
enableMixedClustersupport to restrict RuntimeClass scheduling per node class on clusters with both bare-metal and VM worker nodes, with automatic detection of nested-virt-capable VMs.<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->
- TODO
nested virt can run Kata sandboxes via KVM-on-KVM. This iteration
does not distinguish nested-virt-capable VMs from non-capable ones, all VM
nodes are labeled
virtualand routed tokata-remote(peer pods).