Skip to content

feat(kubernetes): add cpu-pinning-operator as a CPU pinning policy - #195

Draft
kwisniewski98 wants to merge 3 commits into
intel:mainfrom
kwisniewski98:feat/cpu-pinning-operator
Draft

kwisniewski98 wants to merge 3 commits into
intel:mainfrom
kwisniewski98:feat/cpu-pinning-operator

Conversation

@kwisniewski98

@kwisniewski98 kwisniewski98 commented Nov 30, 2026 •

Copy link
Copy Markdown

Description

Adds intel/cpu-pinning-operator as a new CPU pinning method: kubernetes_cpu_policy: cpu-pinning-operator.

  • New platform component cpu_pinning_operator (roles/cpu_pinning_operator). It is enabled only for this policy on kubernetes_accelerator: cpu, in place of nri_cpu_balloons.
    • The upstream project publishes no chart repository, so the chart is installed from a checkout of the v1.0.0 tag into .cpu-pinning-operator/. The chart bundles the NRI balloons plugin.
  • What it pins: model-manager's serving containers main (vLLM) and kserve-container (OVMS) in llm-inference. The span comes from --tensor-parallel-size.
  • Reserved CPUs: sized by the same settings as nri-balloons, so switching policy keeps the split:
    • nri_deployment_profile: siblings (default): physical cores for models, every hyperthread sibling reserved (cpuAllocation: physical-cores, htSiblingPolicy: reserved).
    • minimal / standard / observability / full: 8 / 12 / 16 / 20 CPUs reserved, and models may get hyperthreads (cpuAllocation: hyperthreads, reserved.cpus).
    • nri_reserved_cpu_list: that many CPUs reserved. The operator takes a count, not CPU IDs.
  • GPU pods: pinned too. The component runs on any kubernetes_accelerator, and preflight no longer downgrades this policy to best-effort. The operator puts GPU pods in balloon-device, which needs the whole-core CPU limit model-manager adds in feat(model-manager): add cpu-pinning-operator CPU policy inference-toolkit#102. The cores are dedicated but not NUMA-local to the GPU: that would need the alpha KubeletPodResourcesGet gate, which upstream advises leaving off.
  • Install:
    • refuses to run while the nri_cpu_balloons plugin is still in kube-system, because two plugins would fight over the same cpusets.
    • waits for BalloonsClusterConfig/cluster to be Ready, so model pods are not admitted unpinned.
  • Teardown: teardown: role, via helm uninstall. The chart's hooks remove the guard webhook and the operator's node labels. Teardown then deletes the operator CRDs and balloonspolicies.config.nri. The NodeResourceTopology CRD is kept because it is shared.
  • Intel® Priority Core Turbo: on by default (cpu_pinning_operator_pct_enabled: true sets the plugin's allowPCT). The plugin applies the operator's CPU classes through SST-CP: GPU pods' cores (balloon-device) get high priority, CPU model balloons low, and the reserved pool none.
    • It needs a privileged plugin pod with the host's /dev mounted (on OpenShift, the privileged SCC).
    • On nodes without /dev/isst_interface the plugin logs SST not supported and ignores the classes. Checked in nri-plugins v0.15.2: pct.go and goresctrl SstSupported, with the device looked up under --host-root /host.
  • Observability: with observability_enabled, the Grafana per-node and cluster dashboards are switched on, and kube-prometheus-stack-prometheus is bound to the metrics reader role. The component runs after observability, so the chart finds the ServiceMonitor CRD.
  • OpenShift: uses the settings from the chart's values-openshift.yaml (probe SCC, the plugin's SCC grant, openshift-* in the reserved pool), but not its measured reserved sizing, so the profile decides there too. The metrics reader is user-workload monitoring's Prometheus.
  • Preflight: accepts the value and keeps kubelet cpuManagerPolicy: none, on CPU and GPU clusters. Nothing new goes into the kubespray extra vars.
  • Settings: cpu_pinning_operator_version, _containers, _namespaces, and cpu_pinning_operator_extra_values for any other chart value. Also the existing nri_deployment_profile and nri_reserved_cpu_list.
  • Docs: new docs/configuration/cpu-pinning-operator.md, plus the configuration, architecture, CLI, labels and index pages.

Related PRs / merge order

Tests

  • python3 -m pytest -q src/tests/unit: 800 passed.
    • New tests: component order after cert_manager and observability, kept on teardown inference, exactly one balloons installer per kubernetes_cpu_policy, and the operator still enabled on a non-CPU accelerator.
  • ansible-lint --skip-list name,var-naming,fqcn,yaml,jinja,key-order on the new role and preflight: passed.
  • With PCT on and off, on Kubernetes and OpenShift: the plugin DaemonSet is privileged with /host/dev mounted only when PCT is on, and on OpenShift it is then bound to the privileged SCC.
  • Ansible rendered the role's Helm values for siblings, full and nri_reserved_cpu_list: 0-3,64-67, each on Kubernetes and OpenShift. helm template of the v1.0.0 chart accepted all six: BalloonsClusterConfig gets physical-cores + htSiblingPolicy: reserved, hyperthreads + 20 reserved, and hyperthreads + 8 reserved. An unknown profile stops with a clear message.
  • Ran the role's values expression and the preflight policy tasks in a local Ansible play:
    • the extra_values merge works;
    • nri_cpu_balloons_enabled and the kubelet policy are right for each policy.
  • Not yet run on a cluster. To do before review, per adding-solutions.md §9: install platform with the policy, validate cpu_pinning_operator, a second install with zero changes, deploy qwen3-0-6b and check Cpus_allowed_list, then teardown twice.

Limitations

  • No placement pre-flight in model-manager under this policy. The operator's capacity check (warn by default) is the only one.
  • Helm does not upgrade CRDs. A future operator release that changes its CRDs needs them applied first (marked in install.yaml).
  • The OpenShift metrics reader (openshift-user-workload-monitoring/prometheus-user-workload) is untested.
  • nri_reserved_cpu_list keeps only its size: the operator chooses which CPUs.
  • GPU pods' cores are not NUMA-local to the GPU (see above).
  • With PCT on an SST-capable node, CPU model balloons are low priority, so a CPU-only inference node could run them at a lower turbo frequency than platform pods. To measure on PCT hardware before marking ready.
  • Switching from nri-balloons is manual: undeploy the models, teardown nri_cpu_balloons, switch the policy, install. This is documented.

kubernetes_cpu_policy: cpu-pinning-operator installs intel/cpu-pinning-operator
(chart from the v1.0.0 tag) as the new platform component cpu_pinning_operator,
in place of nri_cpu_balloons. Its webhook pins model-manager's serving
containers (main, kserve-container) in llm-inference; hyperthread siblings
form the reserved pool, as with the nri-balloons siblings profile.

- preflight accepts the value and keeps kubelet cpuManagerPolicy=none
- install refuses to run next to the nri_cpu_balloons plugin
- install waits for BalloonsClusterConfig/cluster Ready
- teardown uses helm uninstall so the chart's hooks run
- Grafana dashboards and the Prometheus metrics reader follow observability
- docs: docs/configuration/cpu-pinning-operator.md and reference updates

Signed-off-by: kwisniewski98 <krzysztof2.wisniewski@intel.com>
…; pin GPU pods

Reserved pool: drop cpu_pinning_operator_ht_sibling_policy and read
nri_deployment_profile / nri_reserved_cpu_list, as nri-balloons does:
- siblings (default): physical cores for models, hyperthread siblings reserved
- minimal | standard | observability | full: 8 | 12 | 16 | 20 CPUs reserved,
  models may get hyperthreads
- nri_reserved_cpu_list: that many CPUs (the operator takes a count)
On OpenShift the chart overlay's measured sizing is no longer applied, so the
profile decides there too; its SCC and reserved-namespace settings stay.

GPU: cpu_pinning_operator no longer requires kubernetes_accelerator: cpu, and
preflight no longer downgrades this policy to best-effort on GPU clusters. The
operator pins GPU pods in its balloon-device type (needs model-manager to give
them a whole-core CPU limit, intel/inference-toolkit#102).

Signed-off-by: kwisniewski98 <krzysztof2.wisniewski@intel.com>
…g Operator

cpu_pinning_operator_pct_enabled (default true) sets the bundled balloons
plugin's allowPCT, so it applies the operator's CPU classes through SST-CP:
GPU pods' cores (balloon-device) high priority, CPU model balloons low. The
plugin then runs privileged with the host's /dev mounted (on OpenShift the
privileged SCC). On nodes without /dev/isst_interface the plugin logs that
SST is not supported and ignores the classes.

Signed-off-by: kwisniewski98 <krzysztof2.wisniewski@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant