From d755f69b6cfb57ffb9406a17755645ea46bafb59 Mon Sep 17 00:00:00 2001 From: Kaustubh Dhokte Date: Wed, 7 Feb 2024 18:30:46 +0000 Subject: [PATCH] Remove support for ignoring isolated CPUs in k8s As we no longer have any users for this feature, we remove the patch enable-support-for-kubernetes-to-ignore-isolcpus.patch from the repo. Test Plan: PASS: Each affected kubernetes version package builds successfully. Story: 2010878 Task: 49546 Change-Id: Id21fe6cd029d4b3cd6e6bd920628dfcc4703f6b2 Signed-off-by: Kaustubh Dhokte --- ...rt-for-kubernetes-to-ignore-isolcpus.patch | 80 ------------------ .../debian/deb_folder/patches/series | 1 - ...rt-for-kubernetes-to-ignore-isolcpus.patch | 80 ------------------ .../debian/deb_folder/patches/series | 1 - ...rt-for-kubernetes-to-ignore-isolcpus.patch | 81 ------------------- .../debian/deb_folder/patches/series | 1 - ...rt-for-kubernetes-to-ignore-isolcpus.patch | 74 ----------------- .../debian/deb_folder/patches/series | 1 - 8 files changed, 319 deletions(-) delete mode 100644 kubernetes/kubernetes-1.25.3/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch delete mode 100644 kubernetes/kubernetes-1.26.1/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch delete mode 100644 kubernetes/kubernetes-1.27.5/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch delete mode 100644 kubernetes/kubernetes-1.28.4/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch diff --git a/kubernetes/kubernetes-1.25.3/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch b/kubernetes/kubernetes-1.25.3/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch deleted file mode 100644 index 5071436b2..000000000 --- a/kubernetes/kubernetes-1.25.3/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 9210e290761240651110318df52fb81199fe46ae Mon Sep 17 00:00:00 2001 -From: Chris Friesen -Date: Fri, 23 Oct 2020 17:46:10 -0600 -Subject: [PATCH] enable support for kubernetes to ignore isolcpus - -The normal mechanisms for allocating isolated CPUs do not allow -a mix of isolated and exclusive CPUs in the same container. In -order to allow this in *very* limited cases where the pod spec -is known in advance we will add the ability to disable the normal -isolcpus behaviour. - -If the file "/etc/kubernetes/ignore_isolcpus" exists, then kubelet -will basically forget everything it knows about isolcpus and just -treat them like regular CPUs. - -The admin user can then rely on the fact that CPU allocation is -deterministic to ensure that the isolcpus they configure end up being -allocated to the correct pods. - -Signed-off-by: Daniel Safta -Signed-off-by: Ramesh Kumar Sivanandam ---- - pkg/kubelet/cm/cpumanager/cpu_manager.go | 8 ++++++++ - pkg/kubelet/cm/cpumanager/policy_static.go | 7 +++++++ - 2 files changed, 15 insertions(+) - -diff --git a/pkg/kubelet/cm/cpumanager/cpu_manager.go b/pkg/kubelet/cm/cpumanager/cpu_manager.go -index 5a5c4ad9f6f..ae46929c174 100644 ---- a/pkg/kubelet/cm/cpumanager/cpu_manager.go -+++ b/pkg/kubelet/cm/cpumanager/cpu_manager.go -@@ -20,6 +20,7 @@ import ( - "fmt" - "io/ioutil" - "math" -+ "os" - "strings" - "sync" - "time" -@@ -55,6 +56,13 @@ const cpuManagerStateFileName = "cpu_manager_state" - - // get the system-level isolated CPUs - func getIsolcpus() cpuset.CPUSet { -+ // This is a gross hack to basically turn off awareness of isolcpus to enable -+ // isolated cpus to be allocated to pods the same way as non-isolated CPUs. -+ if _, err := os.Stat("/etc/kubernetes/ignore_isolcpus"); err == nil { -+ klog.Infof("[cpumanager] turning off isolcpus awareness") -+ return cpuset.NewCPUSet() -+ } -+ - dat, err := ioutil.ReadFile("/sys/devices/system/cpu/isolated") - if err != nil { - klog.Errorf("[cpumanager] unable to read sysfs isolcpus subdir") -diff --git a/pkg/kubelet/cm/cpumanager/policy_static.go b/pkg/kubelet/cm/cpumanager/policy_static.go -index 802e289bfaf..a17a0432bfb 100644 ---- a/pkg/kubelet/cm/cpumanager/policy_static.go -+++ b/pkg/kubelet/cm/cpumanager/policy_static.go -@@ -18,6 +18,7 @@ package cpumanager - - import ( - "fmt" -+ "os" - "strconv" - - v1 "k8s.io/api/core/v1" -@@ -685,6 +686,12 @@ func isKubeInfra(pod *v1.Pod) bool { - - // get the isolated CPUs (if any) from the devices associated with a specific container - func (p *staticPolicy) podIsolCPUs(pod *v1.Pod, container *v1.Container) cpuset.CPUSet { -+ // This is a gross hack to basically turn off awareness of isolcpus to enable -+ // isolated cpus to be allocated to pods the same way as non-isolated CPUs. -+ if _, err := os.Stat("/etc/kubernetes/ignore_isolcpus"); err == nil { -+ return cpuset.NewCPUSet() -+ } -+ - // NOTE: This is required for TestStaticPolicyAdd() since makePod() does - // not create UID. We also need a way to properly stub devicemanager. - if len(string(pod.UID)) == 0 { --- -2.25.1 - diff --git a/kubernetes/kubernetes-1.25.3/debian/deb_folder/patches/series b/kubernetes/kubernetes-1.25.3/debian/deb_folder/patches/series index 601343ac8..92fe6a1cf 100644 --- a/kubernetes/kubernetes-1.25.3/debian/deb_folder/patches/series +++ b/kubernetes/kubernetes-1.25.3/debian/deb_folder/patches/series @@ -6,7 +6,6 @@ kubelet-cpumanager-disable-CFS-quota-throttling.patch kubelet-cpumanager-keep-normal-containers-off-reserv.patch kubelet-cpumanager-infra-pods-use-system-reserved-CP.patch kubelet-cpumanager-introduce-concept-of-isolated-CPU.patch -enable-support-for-kubernetes-to-ignore-isolcpus.patch kubelet-CFS-quota-throttling-for-non-integer-cpulimit.patch Revert-kubeadm-remove-RemoveOldControlPlaneLabel.patch Revert-kubeadm-cleanup-the-master-taint-on-CP-nodes-.patch diff --git a/kubernetes/kubernetes-1.26.1/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch b/kubernetes/kubernetes-1.26.1/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch deleted file mode 100644 index 466b2bbca..000000000 --- a/kubernetes/kubernetes-1.26.1/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 47e087ce7045aaf74cb4f3c845785a4cca101c4d Mon Sep 17 00:00:00 2001 -From: Chris Friesen -Date: Fri, 23 Oct 2020 17:46:10 -0600 -Subject: [PATCH 09/10] enable support for kubernetes to ignore isolcpus - -The normal mechanisms for allocating isolated CPUs do not allow -a mix of isolated and exclusive CPUs in the same container. In -order to allow this in *very* limited cases where the pod spec -is known in advance we will add the ability to disable the normal -isolcpus behaviour. - -If the file "/etc/kubernetes/ignore_isolcpus" exists, then kubelet -will basically forget everything it knows about isolcpus and just -treat them like regular CPUs. - -The admin user can then rely on the fact that CPU allocation is -deterministic to ensure that the isolcpus they configure end up being -allocated to the correct pods. - -Signed-off-by: Daniel Safta -Signed-off-by: Ramesh Kumar Sivanandam ---- - pkg/kubelet/cm/cpumanager/cpu_manager.go | 8 ++++++++ - pkg/kubelet/cm/cpumanager/policy_static.go | 7 +++++++ - 2 files changed, 15 insertions(+) - -diff --git a/pkg/kubelet/cm/cpumanager/cpu_manager.go b/pkg/kubelet/cm/cpumanager/cpu_manager.go -index 95a4246e840..846a6d4fbed 100644 ---- a/pkg/kubelet/cm/cpumanager/cpu_manager.go -+++ b/pkg/kubelet/cm/cpumanager/cpu_manager.go -@@ -21,6 +21,7 @@ import ( - "fmt" - "io/ioutil" - "math" -+ "os" - "strings" - "sync" - "time" -@@ -56,6 +57,13 @@ const cpuManagerStateFileName = "cpu_manager_state" - - // get the system-level isolated CPUs - func getIsolcpus() cpuset.CPUSet { -+ // This is a gross hack to basically turn off awareness of isolcpus to enable -+ // isolated cpus to be allocated to pods the same way as non-isolated CPUs. -+ if _, err := os.Stat("/etc/kubernetes/ignore_isolcpus"); err == nil { -+ klog.Infof("[cpumanager] turning off isolcpus awareness") -+ return cpuset.NewCPUSet() -+ } -+ - dat, err := ioutil.ReadFile("/sys/devices/system/cpu/isolated") - if err != nil { - klog.Errorf("[cpumanager] unable to read sysfs isolcpus subdir") -diff --git a/pkg/kubelet/cm/cpumanager/policy_static.go b/pkg/kubelet/cm/cpumanager/policy_static.go -index 8d18ce65309..981e825ff57 100644 ---- a/pkg/kubelet/cm/cpumanager/policy_static.go -+++ b/pkg/kubelet/cm/cpumanager/policy_static.go -@@ -18,6 +18,7 @@ package cpumanager - - import ( - "fmt" -+ "os" - "strconv" - - v1 "k8s.io/api/core/v1" -@@ -700,6 +701,12 @@ func isKubeInfra(pod *v1.Pod) bool { - - // get the isolated CPUs (if any) from the devices associated with a specific container - func (p *staticPolicy) podIsolCPUs(pod *v1.Pod, container *v1.Container) cpuset.CPUSet { -+ // This is a gross hack to basically turn off awareness of isolcpus to enable -+ // isolated cpus to be allocated to pods the same way as non-isolated CPUs. -+ if _, err := os.Stat("/etc/kubernetes/ignore_isolcpus"); err == nil { -+ return cpuset.NewCPUSet() -+ } -+ - // NOTE: This is required for TestStaticPolicyAdd() since makePod() does - // not create UID. We also need a way to properly stub devicemanager. - if len(string(pod.UID)) == 0 { --- -2.25.1 - diff --git a/kubernetes/kubernetes-1.26.1/debian/deb_folder/patches/series b/kubernetes/kubernetes-1.26.1/debian/deb_folder/patches/series index e3a685ade..df06fc834 100644 --- a/kubernetes/kubernetes-1.26.1/debian/deb_folder/patches/series +++ b/kubernetes/kubernetes-1.26.1/debian/deb_folder/patches/series @@ -7,5 +7,4 @@ kubelet-cpumanager-keep-normal-containers-off-reserv.patch kubelet-cpumanager-infra-pods-use-system-reserved-CP.patch kubelet-cpumanager-introduce-concept-of-isolated-CPU.patch Affinity-of-guaranteed-pod-to-non-isolated-CPUs.patch -enable-support-for-kubernetes-to-ignore-isolcpus.patch kubelet-CFS-quota-throttling-for-non-integer-cpulimit.patch diff --git a/kubernetes/kubernetes-1.27.5/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch b/kubernetes/kubernetes-1.27.5/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch deleted file mode 100644 index f4cf71c00..000000000 --- a/kubernetes/kubernetes-1.27.5/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 5c789dcd87cd6db69e53399a581d61c8fb308f7d Mon Sep 17 00:00:00 2001 -From: Boovan Rajendran -Date: Mon, 4 Sep 2023 08:25:03 -0400 -Subject: [PATCH] enable support for kubernetes to ignore isolcpus - -The normal mechanisms for allocating isolated CPUs do not allow -a mix of isolated and exclusive CPUs in the same container. In -order to allow this in *very* limited cases where the pod spec -is known in advance we will add the ability to disable the normal -isolcpus behaviour. - -If the file "/etc/kubernetes/ignore_isolcpus" exists, then kubelet -will basically forget everything it knows about isolcpus and just -treat them like regular CPUs. - -The admin user can then rely on the fact that CPU allocation is -deterministic to ensure that the isolcpus they configure end up being -allocated to the correct pods. - -Signed-off-by: Daniel Safta -Signed-off-by: Ramesh Kumar Sivanandam -Signed-off-by: Boovan Rajendran ---- - pkg/kubelet/cm/cpumanager/cpu_manager.go | 8 ++++++++ - pkg/kubelet/cm/cpumanager/policy_static.go | 7 +++++++ - 2 files changed, 15 insertions(+) - -diff --git a/pkg/kubelet/cm/cpumanager/cpu_manager.go b/pkg/kubelet/cm/cpumanager/cpu_manager.go -index 6e9d3938aef..0f48d521d6f 100644 ---- a/pkg/kubelet/cm/cpumanager/cpu_manager.go -+++ b/pkg/kubelet/cm/cpumanager/cpu_manager.go -@@ -21,6 +21,7 @@ import ( - "fmt" - "io/ioutil" - "math" -+ "os" - "strings" - "sync" - "time" -@@ -56,6 +57,13 @@ const cpuManagerStateFileName = "cpu_manager_state" - - // get the system-level isolated CPUs - func getIsolcpus() cpuset.CPUSet { -+ // This is a gross hack to basically turn off awareness of isolcpus to enable -+ // isolated cpus to be allocated to pods the same way as non-isolated CPUs. -+ if _, err := os.Stat("/etc/kubernetes/ignore_isolcpus"); err == nil { -+ klog.Infof("[cpumanager] turning off isolcpus awareness") -+ return cpuset.New() -+ } -+ - dat, err := ioutil.ReadFile("/sys/devices/system/cpu/isolated") - if err != nil { - klog.Errorf("[cpumanager] unable to read sysfs isolcpus subdir") -diff --git a/pkg/kubelet/cm/cpumanager/policy_static.go b/pkg/kubelet/cm/cpumanager/policy_static.go -index ab4164e8736..54bcfdb71a1 100644 ---- a/pkg/kubelet/cm/cpumanager/policy_static.go -+++ b/pkg/kubelet/cm/cpumanager/policy_static.go -@@ -18,6 +18,7 @@ package cpumanager - - import ( - "fmt" -+ "os" - "strconv" - - v1 "k8s.io/api/core/v1" -@@ -752,6 +753,12 @@ func isKubeInfra(pod *v1.Pod) bool { - - // get the isolated CPUs (if any) from the devices associated with a specific container - func (p *staticPolicy) podIsolCPUs(pod *v1.Pod, container *v1.Container) cpuset.CPUSet { -+ // This is a gross hack to basically turn off awareness of isolcpus to enable -+ // isolated cpus to be allocated to pods the same way as non-isolated CPUs. -+ if _, err := os.Stat("/etc/kubernetes/ignore_isolcpus"); err == nil { -+ return cpuset.New() -+ } -+ - // NOTE: This is required for TestStaticPolicyAdd() since makePod() does - // not create UID. We also need a way to properly stub devicemanager. - if len(string(pod.UID)) == 0 { --- -2.25.1 - diff --git a/kubernetes/kubernetes-1.27.5/debian/deb_folder/patches/series b/kubernetes/kubernetes-1.27.5/debian/deb_folder/patches/series index e3a685ade..df06fc834 100644 --- a/kubernetes/kubernetes-1.27.5/debian/deb_folder/patches/series +++ b/kubernetes/kubernetes-1.27.5/debian/deb_folder/patches/series @@ -7,5 +7,4 @@ kubelet-cpumanager-keep-normal-containers-off-reserv.patch kubelet-cpumanager-infra-pods-use-system-reserved-CP.patch kubelet-cpumanager-introduce-concept-of-isolated-CPU.patch Affinity-of-guaranteed-pod-to-non-isolated-CPUs.patch -enable-support-for-kubernetes-to-ignore-isolcpus.patch kubelet-CFS-quota-throttling-for-non-integer-cpulimit.patch diff --git a/kubernetes/kubernetes-1.28.4/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch b/kubernetes/kubernetes-1.28.4/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch deleted file mode 100644 index ae1e13f77..000000000 --- a/kubernetes/kubernetes-1.28.4/debian/deb_folder/patches/enable-support-for-kubernetes-to-ignore-isolcpus.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 4714c7f51561af27f7aec64efe8dc128ee0fb8bc Mon Sep 17 00:00:00 2001 -From: Saba Touheed Mujawar -Date: Tue, 12 Dec 2023 08:57:04 -0500 -Subject: [PATCH] enable support for kubernetes to ignore isolcpus - -The normal mechanisms for allocating isolated CPUs do not allow -a mix of isolated and exclusive CPUs in the same container. In -order to allow this in *very* limited cases where the pod spec -is known in advance we will add the ability to disable the normal -isolcpus behaviour. - -If the file "/etc/kubernetes/ignore_isolcpus" exists, then kubelet -will basically forget everything it knows about isolcpus and just -treat them like regular CPUs. - -The admin user can then rely on the fact that CPU allocation is -deterministic to ensure that the isolcpus they configure end up being -allocated to the correct pods. - -Signed-off-by: Daniel Safta -Signed-off-by: Ramesh Kumar Sivanandam -Signed-off-by: Boovan Rajendran -Signed-off-by: Saba Touheed Mujawar ---- - pkg/kubelet/cm/cpumanager/cpu_manager.go | 7 +++++++ - pkg/kubelet/cm/cpumanager/policy_static.go | 7 +++++++ - 2 files changed, 14 insertions(+) - -diff --git a/pkg/kubelet/cm/cpumanager/cpu_manager.go b/pkg/kubelet/cm/cpumanager/cpu_manager.go -index 396d9358a04..ebd6e2917ab 100644 ---- a/pkg/kubelet/cm/cpumanager/cpu_manager.go -+++ b/pkg/kubelet/cm/cpumanager/cpu_manager.go -@@ -56,6 +56,13 @@ const cpuManagerStateFileName = "cpu_manager_state" - - // get the system-level isolated CPUs - func getIsolcpus() cpuset.CPUSet { -+ // This is a gross hack to basically turn off awareness of isolcpus to enable -+ // isolated cpus to be allocated to pods the same way as non-isolated CPUs. -+ if _, err := os.Stat("/etc/kubernetes/ignore_isolcpus"); err == nil { -+ klog.Infof("[cpumanager] turning off isolcpus awareness") -+ return cpuset.New() -+ } -+ - dat, err := os.ReadFile("/sys/devices/system/cpu/isolated") - if err != nil { - klog.Errorf("[cpumanager] unable to read sysfs isolcpus subdir") -diff --git a/pkg/kubelet/cm/cpumanager/policy_static.go b/pkg/kubelet/cm/cpumanager/policy_static.go -index c76a6edbc20..9425f5b27fb 100644 ---- a/pkg/kubelet/cm/cpumanager/policy_static.go -+++ b/pkg/kubelet/cm/cpumanager/policy_static.go -@@ -18,6 +18,7 @@ package cpumanager - - import ( - "fmt" -+ "os" - "strconv" - - v1 "k8s.io/api/core/v1" -@@ -755,6 +756,12 @@ func isKubeInfra(pod *v1.Pod) bool { - - // get the isolated CPUs (if any) from the devices associated with a specific container - func (p *staticPolicy) podIsolCPUs(pod *v1.Pod, container *v1.Container) cpuset.CPUSet { -+ // This is a gross hack to basically turn off awareness of isolcpus to enable -+ // isolated cpus to be allocated to pods the same way as non-isolated CPUs. -+ if _, err := os.Stat("/etc/kubernetes/ignore_isolcpus"); err == nil { -+ return cpuset.New() -+ } -+ - // NOTE: This is required for TestStaticPolicyAdd() since makePod() does - // not create UID. We also need a way to properly stub devicemanager. - if len(string(pod.UID)) == 0 { --- -2.25.1 - diff --git a/kubernetes/kubernetes-1.28.4/debian/deb_folder/patches/series b/kubernetes/kubernetes-1.28.4/debian/deb_folder/patches/series index a0cf7c144..c463853d2 100644 --- a/kubernetes/kubernetes-1.28.4/debian/deb_folder/patches/series +++ b/kubernetes/kubernetes-1.28.4/debian/deb_folder/patches/series @@ -6,5 +6,4 @@ kubelet-cpumanager-keep-normal-containers-off-reserv.patch kubelet-cpumanager-infra-pods-use-system-reserved-CP.patch kubelet-cpumanager-introduce-concept-of-isolated-CPU.patch Affinity-of-guaranteed-pod-to-non-isolated-CPUs.patch -enable-support-for-kubernetes-to-ignore-isolcpus.patch kubelet-CFS-quota-throttling-for-non-integer-cpulimit.patch