From 8a2372220b0b7a312c75e77c427f42e2ff39e51b Mon Sep 17 00:00:00 2001 From: jmontesi Date: Mon, 10 Aug 2026 12:56:00 +0200 Subject: [PATCH] CNF-22163: Enable kubelet GracefulNodeShutdown in RAN DU PerformanceProfile 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 --- .../functions/unordered_list.tmpl | 16 +++++++++++++++- .../hack/arch/aarch64.yaml | 4 +++- .../kube-compare-reference/hack/arch/x86_64.yaml | 4 +++- .../aarch64/PerformanceProfile-SetSelector.yaml | 6 +++++- .../aarch64/PerformanceProfile.yaml | 6 +++++- .../x86_64/PerformanceProfile-SetSelector.yaml | 6 +++++- .../x86_64/PerformanceProfile.yaml | 6 +++++- 7 files changed, 41 insertions(+), 7 deletions(-) diff --git a/telco-ran/configuration/kube-compare-reference/functions/unordered_list.tmpl b/telco-ran/configuration/kube-compare-reference/functions/unordered_list.tmpl index cb447b156..778a3f709 100644 --- a/telco-ran/configuration/kube-compare-reference/functions/unordered_list.tmpl +++ b/telco-ran/configuration/kube-compare-reference/functions/unordered_list.tmpl @@ -69,6 +69,14 @@ {{- if hasKey $inputSystemReserved "memory" }} {{- $systemReservedMemory = printf "\"%s\"" $inputSystemReserved.memory }} {{- end }} +{{- end }} +{{- $shutdownGracePeriod := "" }} +{{- if hasKey $config "shutdownGracePeriod" }} +{{- $shutdownGracePeriod = $config.shutdownGracePeriod }} +{{- end }} +{{- $shutdownGracePeriodCriticalPods := "" }} +{{- if hasKey $config "shutdownGracePeriodCriticalPods" }} +{{- $shutdownGracePeriodCriticalPods = $config.shutdownGracePeriodCriticalPods }} {{- end }} kubeletconfig.experimental: | { @@ -76,7 +84,13 @@ "allowedUnsafeSysctls":{{ $result | toJson }}, {{- end }} {{- if $systemReservedMemory }} - "systemReserved":{"memory":{{ $systemReservedMemory }}} + "systemReserved":{"memory":{{ $systemReservedMemory }}}, + {{- end }} + {{- if $shutdownGracePeriod }} + "shutdownGracePeriod":"{{ $shutdownGracePeriod }}", + {{- end }} + {{- if $shutdownGracePeriodCriticalPods }} + "shutdownGracePeriodCriticalPods":"{{ $shutdownGracePeriodCriticalPods }}" {{- end }} } {{- end }} diff --git a/telco-ran/configuration/kube-compare-reference/hack/arch/aarch64.yaml b/telco-ran/configuration/kube-compare-reference/hack/arch/aarch64.yaml index 46e7b0bf4..8c5dbb694 100644 --- a/telco-ran/configuration/kube-compare-reference/hack/arch/aarch64.yaml +++ b/telco-ran/configuration/kube-compare-reference/hack/arch/aarch64.yaml @@ -3,7 +3,9 @@ node_tuning_operator_PerformanceProfile: annotations: kubeletconfig.experimental: | { - "systemReserved":{"memory":"11Gi"} + "systemReserved":{"memory":"11Gi"}, + "shutdownGracePeriod":"30s", + "shutdownGracePeriodCriticalPods":"10s" } spec: additionalKernelArgs: diff --git a/telco-ran/configuration/kube-compare-reference/hack/arch/x86_64.yaml b/telco-ran/configuration/kube-compare-reference/hack/arch/x86_64.yaml index c4c9fea17..9b3e9a425 100644 --- a/telco-ran/configuration/kube-compare-reference/hack/arch/x86_64.yaml +++ b/telco-ran/configuration/kube-compare-reference/hack/arch/x86_64.yaml @@ -3,7 +3,9 @@ node_tuning_operator_PerformanceProfile: annotations: kubeletconfig.experimental: | { - "systemReserved":{"memory":"11Gi"} + "systemReserved":{"memory":"11Gi"}, + "shutdownGracePeriod":"30s", + "shutdownGracePeriodCriticalPods":"10s" } spec: additionalKernelArgs: diff --git a/telco-ran/configuration/source-crs/node-tuning-operator/aarch64/PerformanceProfile-SetSelector.yaml b/telco-ran/configuration/source-crs/node-tuning-operator/aarch64/PerformanceProfile-SetSelector.yaml index 67c1026ae..385800aa6 100644 --- a/telco-ran/configuration/source-crs/node-tuning-operator/aarch64/PerformanceProfile-SetSelector.yaml +++ b/telco-ran/configuration/source-crs/node-tuning-operator/aarch64/PerformanceProfile-SetSelector.yaml @@ -10,9 +10,13 @@ metadata: ran.openshift.io/ztp-deploy-wave: "10" ran.openshift.io/reference-configuration: "ran-du.redhat.com" # systemReserved: when used, it should be tailored for each environment. + # shutdownGracePeriod: enables kubelet GracefulNodeShutdown to reduce + # IBU upgrade downtime. Non-critical pods get 20s, critical pods get 10s. kubeletconfig.experimental: | { - "systemReserved":{"memory":"11Gi"} + "systemReserved":{"memory":"11Gi"}, + "shutdownGracePeriod":"30s", + "shutdownGracePeriodCriticalPods":"10s" } spec: # Note: The defaults here are for Grace Hopper systems. Other systems may alternative PCI or iommu settings such as: diff --git a/telco-ran/configuration/source-crs/node-tuning-operator/aarch64/PerformanceProfile.yaml b/telco-ran/configuration/source-crs/node-tuning-operator/aarch64/PerformanceProfile.yaml index f10404f82..68f3bf571 100644 --- a/telco-ran/configuration/source-crs/node-tuning-operator/aarch64/PerformanceProfile.yaml +++ b/telco-ran/configuration/source-crs/node-tuning-operator/aarch64/PerformanceProfile.yaml @@ -10,9 +10,13 @@ metadata: ran.openshift.io/ztp-deploy-wave: "10" ran.openshift.io/reference-configuration: "ran-du.redhat.com" # systemReserved: when used, it should be tailored for each environment. + # shutdownGracePeriod: enables kubelet GracefulNodeShutdown to reduce + # IBU upgrade downtime. Non-critical pods get 20s, critical pods get 10s. kubeletconfig.experimental: | { - "systemReserved":{"memory":"11Gi"} + "systemReserved":{"memory":"11Gi"}, + "shutdownGracePeriod":"30s", + "shutdownGracePeriodCriticalPods":"10s" } spec: # Note: The defaults here are for Grace Hopper systems. Other systems may alternative PCI or iommu settings such as: diff --git a/telco-ran/configuration/source-crs/node-tuning-operator/x86_64/PerformanceProfile-SetSelector.yaml b/telco-ran/configuration/source-crs/node-tuning-operator/x86_64/PerformanceProfile-SetSelector.yaml index d49119f19..148d1b150 100644 --- a/telco-ran/configuration/source-crs/node-tuning-operator/x86_64/PerformanceProfile-SetSelector.yaml +++ b/telco-ran/configuration/source-crs/node-tuning-operator/x86_64/PerformanceProfile-SetSelector.yaml @@ -10,9 +10,13 @@ metadata: ran.openshift.io/ztp-deploy-wave: "10" ran.openshift.io/reference-configuration: "ran-du.redhat.com" # systemReserved: when used, it should be tailored for each environment. + # shutdownGracePeriod: enables kubelet GracefulNodeShutdown to reduce + # IBU upgrade downtime. Non-critical pods get 20s, critical pods get 10s. kubeletconfig.experimental: | { - "systemReserved":{"memory":"11Gi"} + "systemReserved":{"memory":"11Gi"}, + "shutdownGracePeriod":"30s", + "shutdownGracePeriodCriticalPods":"10s" } spec: # Optional kernel arguments: diff --git a/telco-ran/configuration/source-crs/node-tuning-operator/x86_64/PerformanceProfile.yaml b/telco-ran/configuration/source-crs/node-tuning-operator/x86_64/PerformanceProfile.yaml index 079224dac..edce0f307 100644 --- a/telco-ran/configuration/source-crs/node-tuning-operator/x86_64/PerformanceProfile.yaml +++ b/telco-ran/configuration/source-crs/node-tuning-operator/x86_64/PerformanceProfile.yaml @@ -10,9 +10,13 @@ metadata: ran.openshift.io/ztp-deploy-wave: "10" ran.openshift.io/reference-configuration: "ran-du.redhat.com" # systemReserved: when used, it should be tailored for each environment. + # shutdownGracePeriod: enables kubelet GracefulNodeShutdown to reduce + # IBU upgrade downtime. Non-critical pods get 20s, critical pods get 10s. kubeletconfig.experimental: | { - "systemReserved":{"memory":"11Gi"} + "systemReserved":{"memory":"11Gi"}, + "shutdownGracePeriod":"30s", + "shutdownGracePeriodCriticalPods":"10s" } spec: # Optional kernel arguments: