Skip to content

CNF-24269 Add Core control-plane PerformanceProfile#806

Open
imiller0 wants to merge 1 commit into
openshift-kni:mainfrom
imiller0:add-core-cp-perfprof
Open

CNF-24269 Add Core control-plane PerformanceProfile#806
imiller0 wants to merge 1 commit into
openshift-kni:mainfrom
imiller0:add-core-cp-perfprof

Conversation

@imiller0

Copy link
Copy Markdown
Collaborator

Add PerformanceProfile and Tuned configuration for Core control-plane MCP. Number of reserved/isolated CPUs, hugepages, and systemReserved memory are all variable content.

The kube-compare reference uses the same PerformanceProfile template for both control plane and worker profiles with differences keyed off the machineConfigPoolSelector.

@openshift-ci openshift-ci Bot requested review from MarSik and fedepaol June 10, 2026 22:08
@openshift-ci

openshift-ci Bot commented Jun 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: imiller0

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a control-plane PerformanceProfile, supplies control-plane CPU allocation values, enhances the Helm PerformanceProfile template to detect/render control-plane profiles, updates the overlay and Tuned recommendation to target control-plane, and updates kube-compare ignore rules.

Changes

Control-plane performance profile configuration

Layer / File(s) Summary
Control-plane profile template values and reference configuration
telco-core/configuration/template-values/hw-types.yaml, telco-core/configuration/reference-crs/required/performance/PerformanceProfile-control-plane.yaml
CPU core allocations (control-plane-reserved, control-plane-isolated) added. New control-plane-profile PerformanceProfile manifest defines kubelet systemReserved, kernel args (irdma blacklist), CPU isolated/reserved, IRQ loadbalancing, master selectors, workload hints, single-NUMA topology, and user-level networking.
Helm template enhancement for control-plane detection and rendering
telco-core/configuration/reference-crs-kube-compare/required/performance/PerformanceProfile.yaml
Helm template computes $isControlPlane from machineConfigPoolSelector, conditionally renames the profile to control-plane-profile, validates/parses kubeletconfig.experimental for control-plane (fails on non-empty allowedUnsafeSysctls), removes example comments from CPU fields, conditionally renders hugepages/kernelPageSize/machineConfigPoolSelector/nodeSelector, and sets net.userLevelNetworking based on control-plane detection.
Overlay integration and tuned profile definition
telco-core/configuration/core-overlay.yaml, telco-core/configuration/reference-crs/required/performance/TunedPerformancePatch.yaml
Overlay adds the control-plane PerformanceProfile reference and templates its CPU values; TunedPerformancePatch recommendations replaced worker entries with a single master (machineconfiguration.openshift.io/role: master) recommendation and adds control-plane-profile with a sysctl override.
Comparison ignore configuration
telco-core/configuration/reference-crs-kube-compare/compare_ignore
Adds required/performance/PerformanceProfile-control-plane.yaml to kube-compare's ignore list with explanatory comment.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the main change: adding a PerformanceProfile for the Core control-plane, which is the primary objective of the changeset.
Description check ✅ Passed The description accurately explains the changes: adding PerformanceProfile and Tuned configuration for control-plane MCP with parameterized values and template reuse between control-plane and worker profiles.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@telco-core/configuration/reference-crs-kube-compare/required/performance/PerformanceProfile.yaml`:
- Around line 14-25: The template currently calls fromJson on the
"kubeletconfig.experimental" annotation without guarding for its absence which
can cause a failure; update the logic that builds $config (where you currently
do {{- $config := (index (.metadata.annotations | default dict)
"kubeletconfig.experimental") | fromJson }}) to default the annotation to an
empty JSON object (e.g., "{}") or skip fromJson when missing, then proceed to
check $config.allowedUnsafeSysctls and render
kubeletconfig.experimental.systemReserved as before; ensure references to
$isControlPlane, kubeletconfig.experimental, $config, fromJson,
allowedUnsafeSysctls, and systemReserved are preserved so the same checks and
fail message remain valid.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 5b66416c-0dac-4f7d-9dcb-b1d089fb8f2e

📥 Commits

Reviewing files that changed from the base of the PR and between fda0964 and e8a21e8.

📒 Files selected for processing (6)
  • telco-core/configuration/core-overlay.yaml
  • telco-core/configuration/reference-crs-kube-compare/compare_ignore
  • telco-core/configuration/reference-crs-kube-compare/required/performance/PerformanceProfile.yaml
  • telco-core/configuration/reference-crs/required/performance/PerformanceProfile-control-plane.yaml
  • telco-core/configuration/reference-crs/required/performance/TunedPerformancePatch.yaml
  • telco-core/configuration/template-values/hw-types.yaml

@imiller0 imiller0 force-pushed the add-core-cp-perfprof branch from e8a21e8 to 30d7b33 Compare June 10, 2026 22:38

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
telco-core/configuration/reference-crs-kube-compare/required/performance/PerformanceProfile.yaml (1)

14-25: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Potential template failure if kubeletconfig.experimental annotation is missing.

The fromJson call on line 16 will fail if the annotation doesn't exist (empty string). This was flagged in a prior review.

Additionally, if systemReserved key is missing from the parsed config, line 24 will produce "systemReserved": null which creates an invalid kubelet configuration.

Proposed fix
    {{- if $isControlPlane }}
    # systemReserved: when used, it should be tailored for each environment.
-   {{- $config := (index (.metadata.annotations | default dict) "kubeletconfig.experimental") | fromJson }}
+   {{- $rawConfig := index (.metadata.annotations | default dict) "kubeletconfig.experimental" }}
+   {{- $config := $rawConfig | default "{}" | fromJson }}
    {{- if hasKey $config "allowedUnsafeSysctls" }}
      {{- if ne (len $config.allowedUnsafeSysctls) 0 }}
        {{- fail "Control plane PerformanceProfile must not have any allowedUnsafeSysctls" }}
      {{- end }}
    {{- end }}
+   {{- if not (hasKey $config "systemReserved") }}
+     {{- fail "Control plane PerformanceProfile must have systemReserved in kubeletconfig.experimental annotation" }}
+   {{- end }}
    kubeletconfig.experimental: |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@telco-core/configuration/reference-crs-kube-compare/required/performance/PerformanceProfile.yaml`
around lines 14 - 25, The template can fail when the
"kubeletconfig.experimental" annotation is missing and can emit invalid JSON if
"systemReserved" is absent; change the parsing to default the annotation to an
empty JSON object string before fromJson (e.g. assign the raw annotation to a
variable with default "{}" and then call fromJson into $config), keep the
existing conditional checks against $config.allowedUnsafeSysctls, and when
rendering kubeletconfig.experimental ensure "systemReserved" is rendered as a
non-null JSON object by using a default empty map (e.g. $config.systemReserved |
default dict) before toJson so the output produces valid JSON instead of null.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In
`@telco-core/configuration/reference-crs-kube-compare/required/performance/PerformanceProfile.yaml`:
- Around line 14-25: The template can fail when the "kubeletconfig.experimental"
annotation is missing and can emit invalid JSON if "systemReserved" is absent;
change the parsing to default the annotation to an empty JSON object string
before fromJson (e.g. assign the raw annotation to a variable with default "{}"
and then call fromJson into $config), keep the existing conditional checks
against $config.allowedUnsafeSysctls, and when rendering
kubeletconfig.experimental ensure "systemReserved" is rendered as a non-null
JSON object by using a default empty map (e.g. $config.systemReserved | default
dict) before toJson so the output produces valid JSON instead of null.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 853bb5bb-8f1e-489e-9379-fd9b42556850

📥 Commits

Reviewing files that changed from the base of the PR and between e8a21e8 and 30d7b33.

📒 Files selected for processing (6)
  • telco-core/configuration/core-overlay.yaml
  • telco-core/configuration/reference-crs-kube-compare/compare_ignore
  • telco-core/configuration/reference-crs-kube-compare/required/performance/PerformanceProfile.yaml
  • telco-core/configuration/reference-crs/required/performance/PerformanceProfile-control-plane.yaml
  • telco-core/configuration/reference-crs/required/performance/TunedPerformancePatch.yaml
  • telco-core/configuration/template-values/hw-types.yaml
✅ Files skipped from review due to trivial changes (1)
  • telco-core/configuration/reference-crs-kube-compare/compare_ignore
🚧 Files skipped from review as they are similar to previous changes (3)
  • telco-core/configuration/template-values/hw-types.yaml
  • telco-core/configuration/reference-crs/required/performance/PerformanceProfile-control-plane.yaml
  • telco-core/configuration/reference-crs/required/performance/TunedPerformancePatch.yaml

@imiller0

Copy link
Copy Markdown
Collaborator Author

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 10, 2026
@imiller0 imiller0 force-pushed the add-core-cp-perfprof branch from 30d7b33 to 8bee47d Compare June 11, 2026 14:16

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@telco-core/configuration/core-overlay.yaml`:
- Around line 135-141: The control-plane PerformanceProfile patch currently only
templates spec.cpu.* and leaves kubeletconfig.experimental.systemReserved.memory
and hugepages hard-coded in
reference-crs/required/performance/PerformanceProfile-control-plane.yaml; update
the overlay to also patch kubeletconfig.experimental.systemReserved.memory and
kubeletconfig.kubeletConfig.podPidsLimit/hugepages (or the hugepages entries
present in that file) by sourcing values from the same hw-types ConfigMap keys
(e.g., add templated patches that read control-plane memory and hugepage sizes
from hw-types, analogous to the existing
control-plane-reserved/control-plane-isolated usage), or alternatively move the
control-plane profile under the same templated path used by worker profiles so
all performance-sensitive fields are consistently parameterized.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 4be7fb8c-e4a6-491f-a6dc-cf4e998abbe2

📥 Commits

Reviewing files that changed from the base of the PR and between 30d7b33 and 8bee47d.

📒 Files selected for processing (6)
  • telco-core/configuration/core-overlay.yaml
  • telco-core/configuration/reference-crs-kube-compare/compare_ignore
  • telco-core/configuration/reference-crs-kube-compare/required/performance/PerformanceProfile.yaml
  • telco-core/configuration/reference-crs/required/performance/PerformanceProfile-control-plane.yaml
  • telco-core/configuration/reference-crs/required/performance/TunedPerformancePatch.yaml
  • telco-core/configuration/template-values/hw-types.yaml
✅ Files skipped from review due to trivial changes (1)
  • telco-core/configuration/template-values/hw-types.yaml
🚧 Files skipped from review as they are similar to previous changes (3)
  • telco-core/configuration/reference-crs-kube-compare/compare_ignore
  • telco-core/configuration/reference-crs/required/performance/PerformanceProfile-control-plane.yaml
  • telco-core/configuration/reference-crs/required/performance/TunedPerformancePatch.yaml

Comment thread telco-core/configuration/core-overlay.yaml
Add PerformanceProfile and Tuned configuration for Core control-plane MCP. Number of
reserved/isolated CPUs, hugepages, and systemReserved memory are all variable content.

The kube-compare reference uses the same PerformanceProfile template for both control plane
and worker profiles with differences keyed off the machineConfigPoolSelector.

Signed-off-by: Ian Miller <imiller@redhat.com>
@imiller0 imiller0 force-pushed the add-core-cp-perfprof branch from 8bee47d to 453b45c Compare June 11, 2026 17:56

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@telco-core/configuration/reference-crs-kube-compare/required/performance/PerformanceProfile.yaml`:
- Around line 55-57: The template is hardcoding defaultHugepagesSize as "1G";
replace the literal with the value from the profile spec so kube-compare renders
the actual requested size. In the block guarded by hasKey .spec "hugepages" (the
hugepages: section), read the size from the profile (e.g.
.spec.hugepages.defaultHugepagesSize or the appropriate
.spec.hugepages.<sizeField> used elsewhere in the PR) and output that value
instead of "1G", preserving YAML structure and indentation so different hugepage
sizes are correctly represented in the generated reference object.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 54323f3c-e239-46c0-9db8-5e4c86ab092a

📥 Commits

Reviewing files that changed from the base of the PR and between 8bee47d and 453b45c.

📒 Files selected for processing (6)
  • telco-core/configuration/core-overlay.yaml
  • telco-core/configuration/reference-crs-kube-compare/compare_ignore
  • telco-core/configuration/reference-crs-kube-compare/required/performance/PerformanceProfile.yaml
  • telco-core/configuration/reference-crs/required/performance/PerformanceProfile-control-plane.yaml
  • telco-core/configuration/reference-crs/required/performance/TunedPerformancePatch.yaml
  • telco-core/configuration/template-values/hw-types.yaml
✅ Files skipped from review due to trivial changes (2)
  • telco-core/configuration/reference-crs-kube-compare/compare_ignore
  • telco-core/configuration/template-values/hw-types.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • telco-core/configuration/reference-crs/required/performance/TunedPerformancePatch.yaml
  • telco-core/configuration/core-overlay.yaml

Comment on lines +55 to 57
{{- if hasKey .spec "hugepages" }}
hugepages:
defaultHugepagesSize: 1G

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Stop hardcoding defaultHugepagesSize in the shared template.

Line 57 always renders 1G, so kube-compare will produce the wrong reference object for any profile that uses a different hugepage size. That breaks the cross-file contract here because this template is the shared comparison source and the PR is explicitly parameterizing hugepages.

♻️ Suggested fix
   hugepages:
-    defaultHugepagesSize: 1G
+    defaultHugepagesSize: {{ .spec.hugepages.defaultHugepagesSize }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{{- if hasKey .spec "hugepages" }}
hugepages:
defaultHugepagesSize: 1G
{{- if hasKey .spec "hugepages" }}
hugepages:
defaultHugepagesSize: {{ .spec.hugepages.defaultHugepagesSize }}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@telco-core/configuration/reference-crs-kube-compare/required/performance/PerformanceProfile.yaml`
around lines 55 - 57, The template is hardcoding defaultHugepagesSize as "1G";
replace the literal with the value from the profile spec so kube-compare renders
the actual requested size. In the block guarded by hasKey .spec "hugepages" (the
hugepages: section), read the size from the profile (e.g.
.spec.hugepages.defaultHugepagesSize or the appropriate
.spec.hugepages.<sizeField> used elsewhere in the PR) and output that value
instead of "1G", preserving YAML structure and indentation so different hugepage
sizes are correctly represented in the generated reference object.

@imiller0

Copy link
Copy Markdown
Collaborator Author

/unhold

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 12, 2026

@bartwensley bartwensley left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment

isolated: {{ .spec.cpu.isolated }}
reserved: {{ .spec.cpu.reserved }}
globallyDisableIrqLoadBalancing: false
{{- if hasKey .spec "hugepages" }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment from Claude:

Previously hugepages was always rendered, so kube-compare would flag any PerformanceProfile missing it. The hasKey guard is necessary for the control-plane profile (which intentionally omits hugepages), but it also makes hugepages optional for worker profiles. A tighter guard like {{- if or (not $isControlPlane) (hasKey .spec "hugepages") }} would keep hugepages mandatory for workers while optional for control-plane.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants