Skip to content

CNF-22163: Enable kubelet GracefulNodeShutdown in RAN DU - #903

Open
jmontesi wants to merge 1 commit into
openshift-kni:mainfrom
jmontesi:main
Open

CNF-22163: Enable kubelet GracefulNodeShutdown in RAN DU #903
jmontesi wants to merge 1 commit into
openshift-kni:mainfrom
jmontesi:main

Conversation

@jmontesi

Copy link
Copy Markdown
Contributor

Add shutdownGracePeriod and shutdownGracePeriodCriticalPods to the kubeletconfig.experimentalannotation in all PerformanceProfile source CRs (x86_64 and aarch64). This enables the kubelet's native GracefulNodeShutdown feature, which reduces IBU upgrade downtime by allowing pods to terminate gracefully before node shutdown.

The kube-compare template and hack arch values are updated to validate and render the new fields with defaults of 30s total (20s non-critical, 10s critical).

…rofile

Add shutdownGracePeriod and shutdownGracePeriodCriticalPods to the
kubeletconfig.experimental annotation in all PerformanceProfile source
CRs (x86_64 and aarch64). This enables the kubelet's native
GracefulNodeShutdown feature, which reduces IBU upgrade downtime by
allowing pods to terminate gracefully before node shutdown.

The kube-compare template and hack arch values are updated to validate
and render the new fields with defaults of 30s total (20s non-critical,
10s critical).

Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci-robot

openshift-ci-robot commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

@jmontesi: This pull request references CNF-22163 which is a valid jira issue.

Details

In response to this:

Add shutdownGracePeriod and shutdownGracePeriodCriticalPods to the kubeletconfig.experimentalannotation in all PerformanceProfile source CRs (x86_64 and aarch64). This enables the kubelet's native GracefulNodeShutdown feature, which reduces IBU upgrade downtime by allowing pods to terminate gracefully before node shutdown.

The kube-compare template and hack arch values are updated to validate and render the new fields with defaults of 30s total (20s non-critical, 10s critical).

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
openshift-ci Bot requested review from MarSik and sabbir-47 August 11, 2026 10:07
@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jmontesi
Once this PR has been reviewed and has the lgtm label, please assign irinamihai for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 commented Aug 11, 2026

Copy link
Copy Markdown

Hi @jmontesi. Thanks for your PR.

I'm waiting for a openshift-kni member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The kubelet configuration template now emits optional graceful shutdown settings. AArch64 and x86_64 reference and source profiles set a 30-second shutdown period and a 10-second critical-pod period.

Changes

Kubelet graceful shutdown

Layer / File(s) Summary
Template output fields
telco-ran/configuration/kube-compare-reference/functions/unordered_list.tmpl
The template conditionally emits shutdownGracePeriod and shutdownGracePeriodCriticalPods in kubeletconfig.experimental.
Architecture profile settings
telco-ran/configuration/kube-compare-reference/hack/arch/*, telco-ran/configuration/source-crs/node-tuning-operator/*/PerformanceProfile*.yaml
AArch64 and x86_64 configurations set shutdownGracePeriod to 30s and shutdownGracePeriodCriticalPods to 10s. Existing systemReserved settings remain configured.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies enabling kubelet GracefulNodeShutdown, which is the main change in the pull request.
Description check ✅ Passed The description accurately explains the new kubelet settings, target profiles, graceful shutdown behavior, and validation updates.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@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-ran/configuration/kube-compare-reference/functions/unordered_list.tmpl`:
- Around line 87-93: Update the unordered-list template’s optional-field comma
handling so rendered JSON remains valid when either or both shutdown
grace-period fields are omitted; emit separators only when a subsequent field
exists, while preserving output when both fields are present. Add render
coverage for both fields present, each field absent individually, and both
fields absent.
🪄 Autofix

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: Pro Plus

Run ID: 8595a980-f64f-4562-991a-314d5362ce80

📥 Commits

Reviewing files that changed from the base of the PR and between 7eeaffa and 8a23722.

📒 Files selected for processing (7)
  • telco-ran/configuration/kube-compare-reference/functions/unordered_list.tmpl
  • telco-ran/configuration/kube-compare-reference/hack/arch/aarch64.yaml
  • telco-ran/configuration/kube-compare-reference/hack/arch/x86_64.yaml
  • telco-ran/configuration/source-crs/node-tuning-operator/aarch64/PerformanceProfile-SetSelector.yaml
  • telco-ran/configuration/source-crs/node-tuning-operator/aarch64/PerformanceProfile.yaml
  • telco-ran/configuration/source-crs/node-tuning-operator/x86_64/PerformanceProfile-SetSelector.yaml
  • telco-ran/configuration/source-crs/node-tuning-operator/x86_64/PerformanceProfile.yaml

Comment on lines +87 to +93
"systemReserved":{"memory":{{ $systemReservedMemory }}},
{{- end }}
{{- if $shutdownGracePeriod }}
"shutdownGracePeriod":"{{ $shutdownGracePeriod }}",
{{- end }}
{{- if $shutdownGracePeriodCriticalPods }}
"shutdownGracePeriodCriticalPods":"{{ $shutdownGracePeriodCriticalPods }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Guard commas for omitted optional fields.

Line 87 and Line 90 always emit trailing commas. Lines 89-94 conditionally emit the following fields. An annotation that omits either field can therefore render invalid JSON, such as {"systemReserved":{"memory":"11Gi"},}. Emit each comma only when a later field exists, or serialize a constructed object instead.

Proposed fix
-       "systemReserved":{"memory":{{ $systemReservedMemory }}},
+       "systemReserved":{"memory":{{ $systemReservedMemory }}}{{ if or $shutdownGracePeriod $shutdownGracePeriodCriticalPods }},{{ end }}
...
-       "shutdownGracePeriod":"{{ $shutdownGracePeriod }}",
+       "shutdownGracePeriod":"{{ $shutdownGracePeriod }}"{{ if $shutdownGracePeriodCriticalPods }},{{ end }}

Add render coverage for both fields present, either field absent, and both fields absent.

📝 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
"systemReserved":{"memory":{{ $systemReservedMemory }}},
{{- end }}
{{- if $shutdownGracePeriod }}
"shutdownGracePeriod":"{{ $shutdownGracePeriod }}",
{{- end }}
{{- if $shutdownGracePeriodCriticalPods }}
"shutdownGracePeriodCriticalPods":"{{ $shutdownGracePeriodCriticalPods }}"
"systemReserved":{"memory":{{ $systemReservedMemory }}}{{ if or $shutdownGracePeriod $shutdownGracePeriodCriticalPods }},{{ end }}
{{- end }}
{{- if $shutdownGracePeriod }}
"shutdownGracePeriod":"{{ $shutdownGracePeriod }}"{{ if $shutdownGracePeriodCriticalPods }},{{ end }}
{{- end }}
{{- if $shutdownGracePeriodCriticalPods }}
"shutdownGracePeriodCriticalPods":"{{ $shutdownGracePeriodCriticalPods }}"
🤖 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-ran/configuration/kube-compare-reference/functions/unordered_list.tmpl`
around lines 87 - 93, Update the unordered-list template’s optional-field comma
handling so rendered JSON remains valid when either or both shutdown
grace-period fields are omitted; emit separators only when a subsequent field
exists, while preserving output when both fields are present. Add render
coverage for both fields present, each field absent individually, and both
fields absent.

@jc-rh

jc-rh commented Aug 11, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 11, 2026
@irinamihai

Copy link
Copy Markdown
Contributor

/hold More testing required.
cc @jc-rh

@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 Aug 11, 2026
@jc-rh

jc-rh commented Aug 18, 2026

Copy link
Copy Markdown
Member

Discussed with Brent and the OCP node team. This is the best solution for SNO despite of some open issues:
https://redhat-internal.slack.com/archives/CK1AE4ZCK/p1786715665943549

@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 Aug 18, 2026
@jc-rh

jc-rh commented Aug 18, 2026

Copy link
Copy Markdown
Member

/test lintcheck

@openshift-ci

openshift-ci Bot commented Aug 18, 2026

Copy link
Copy Markdown

@jmontesi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/lintcheck 8a23722 link true /test lintcheck

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@abraham2512

abraham2512 commented Aug 18, 2026

Copy link
Copy Markdown
Member

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

Labels

ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants