From 10f431d83355fcf9aa87beaa69ce25372353a04f Mon Sep 17 00:00:00 2001 From: Harshal Patil Date: Tue, 13 May 2025 13:49:37 -0400 Subject: [PATCH] Do not set cpu system reserve below the default value Signed-off-by: Harshal Patil --- templates/common/_base/files/kubelet-auto-sizing.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/common/_base/files/kubelet-auto-sizing.yaml b/templates/common/_base/files/kubelet-auto-sizing.yaml index 5812feb2b2..0bf7c5beb2 100644 --- a/templates/common/_base/files/kubelet-auto-sizing.yaml +++ b/templates/common/_base/files/kubelet-auto-sizing.yaml @@ -89,6 +89,10 @@ contents: recommended_systemreserved_cpu=$base_allocation_fraction fi fi + + # Enforce minimum threshold of 0.5 CPU + recommended_systemreserved_cpu=$(awk -v val="$recommended_systemreserved_cpu" 'BEGIN {if (val < 0.5) print 0.5; else print val}') + echo "SYSTEM_RESERVED_CPU=${recommended_systemreserved_cpu}">> ${NODE_SIZES_ENV} } function dynamic_ephemeral_sizing { @@ -145,4 +149,4 @@ contents: static_node_sizing $2 $3 $4 else echo "Unrecognized command line option. Valid options are \"true\" or \"false\"" - fi \ No newline at end of file + fi