Skip to content

Commit

Permalink
Merge pull request #129 from briandowns/issue-128
Browse files Browse the repository at this point in the history
add kernel setting for vm.overcommit_memory=1
  • Loading branch information
briandowns authored Jul 27, 2020
2 parents 3083b77 + 77b7360 commit 52ceb50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ fi
# Enable all options to allow RKE2 to run in CIS mode if set to true. This
# will add an "etcd" system user and will update the following kernel
# parameters and set them to the necessary values:
# vm.overcommit_memory=1
# vm.panic_on_oom=0
# kernel.panic=10
# kernel.panic_on_oops=1
Expand Down Expand Up @@ -883,9 +884,9 @@ setup_etcd_user() {
# update_kernel_params adjusts the necessary kernel parameters
# to allow RKE2 to run in CIS mode.
update_kernel_params() {
for param in vm.panic_on_oom=0 kernel.panic=10 kernel.panic_on_oops=1 kernel.keys.root_maxbytes=25000000; do
sysctl -w ${param}
echo ${param} >> /etc/sysctl.d/local.conf
for param in vm.panic_on_oom=0 kernel.panic=10 kernel.panic_on_oops=1 kernel.keys.root_maxbytes=25000000 vm.overcommit_memory=1; do
${SUDO} sysctl -w ${param}
echo ${param} | ${SUDO} tee -a /etc/sysctl.d/local.conf
done
}

Expand Down

0 comments on commit 52ceb50

Please sign in to comment.