← Back to Pull requests

Feature: Enable mixed cluster(BM+VM nodes) #2972

Closed
unknown closed this pull request without merging on Oct 29, 2026 09:10 UTC
View on GitHub
unknown unknown commented on Sep 16, 2026 13:19 UTC
Author

<!--
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 kata and kata-remote share the same scheduling.nodeSelector (node-role.kubernetes.io/kata-oc).

- What I did
Introduced EnableMixedCluster in KataConfigSpec to activate per-node-class sandbox scheduling. When enabled:

1. The operator deploys a NodeFeatureRule (osc-node-type) via NFD with four
rules 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=true
2. RuntimeClass nodeSelectors are updated per node class:
- kata uses kata-capable=true (matches BM nodes + nested-virt VMs)
- kata-cc, kata-nvidia-gpu, kata-cc-nvidia-gpu use node-type=bare-metal (BM only — TEE/GPU hardware required)
- kata-remote uses node-type=virtual (all VM nodes)
3. Existing RuntimeClasses on a running cluster are patched when EnableMixedCluster is toggled on (update path in createRuntimeClass).
4. The NodeFeatureRule is removed and RuntimeClass nodeSelectors are reverted when EnableMixedCluster is 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 NodeFeatureDiscovery CR
2. Deploy the operator with this change
3. Create a KataConfig with enableMixedCluster: true
4. Verify nodes are labeled:

   oc get nodes -l kataconfiguration.openshift.io/node-type
   oc get nodes -l kataconfiguration.openshift.io/kata-capable
   

5. Verify RuntimeClass nodeSelectors include the correct labels:
   oc get runtimeclass kata -o jsonpath='{.scheduling.nodeSelector}'
   oc get runtimeclass kata-remote -o jsonpath='{.scheduling.nodeSelector}'
   

7. On a VM-only cluster, all nodes should be labeled virtual and kata pods
should stay Pending (no kata-capable node unless nested virt is available)
8. Toggle enableMixedCluster: false and verify labels are removed and
RuntimeClass 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 enableMixedCluster support 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

  • Testing on mixed cluster.

  • Nested virtualization support: VM nodes where the hypervisor exposes

  • 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 virtual and routed to kata-remote (peer pods).

    Diff: 473 lines (+354 / -119) across 5 files Reviewer: pmores Review duration: 61670m
    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
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.7% (MEDIUM) · Higher = larger blast radius
    45.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.1% · Safe to merge
    18.1%