From 37160090688c02fb77c43965a5898a8fc82a90e3 Mon Sep 17 00:00:00 2001 From: Ryan Phillips Date: Wed, 15 Feb 2023 09:29:55 -0600 Subject: [PATCH] UPSTREAM: : add default sysctls for kubelet in rpm --- openshift-hack/sysctls/50-kubelet.conf | 6 ++++++ openshift.spec | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 openshift-hack/sysctls/50-kubelet.conf diff --git a/openshift-hack/sysctls/50-kubelet.conf b/openshift-hack/sysctls/50-kubelet.conf new file mode 100644 index 0000000000000..3a4d5a7b1af63 --- /dev/null +++ b/openshift-hack/sysctls/50-kubelet.conf @@ -0,0 +1,6 @@ +kernel.keys.root_maxbytes=25000000 +kernel.keys.root_maxkeys=1000000 +kernel.panic=10 +kernel.panic_on_oops=1 +vm.overcommit_memory=1 +vm.panic_on_oom=0 diff --git a/openshift.spec b/openshift.spec index 27393775d5086..35d1ecb6320dc 100644 --- a/openshift.spec +++ b/openshift.spec @@ -107,6 +107,7 @@ KUBE_BUILD_PLATFORMS="${BUILD_PLATFORM}" %{os_git_vars} make all WHAT='cmd/kube- PLATFORM="$(go env GOHOSTOS)/$(go env GOHOSTARCH)" install -d %{buildroot}%{_bindir} +install -d %{buildroot}%{_sysctldir} # Install linux components for bin in kube-apiserver kube-controller-manager kube-scheduler kubelet @@ -117,6 +118,10 @@ done install -p -m 755 openshift-hack/images/hyperkube/hyperkube %{buildroot}%{_bindir}/hyperkube install -p -m 755 openshift-hack/images/hyperkube/kubensenter %{buildroot}%{_bindir}/kubensenter +install -p -m 755 openshift-hack/sysctls/50-kubelet.conf %{buildroot}%{_sysctldir}/50-kubelet.conf + +%post +%sysctl_apply 50-kubelet.conf %files hyperkube %license LICENSE @@ -126,6 +131,7 @@ install -p -m 755 openshift-hack/images/hyperkube/kubensenter %{buildroot}%{_bin %{_bindir}/kube-scheduler %{_bindir}/kubelet %{_bindir}/kubensenter +%{_sysctldir}/50-kubelet.conf %defattr(-,root,root,0700) %changelog