Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
set up kernel tunable flags
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx committed Apr 22, 2019
1 parent 7f3a748 commit 83014d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions parts/k8s/cloud-init/artifacts/cse_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -320,4 +320,12 @@ datasource:
Azure:
apply_network_config: false
EOF
}

# refer to https://github.com/kubernetes/kubernetes/blob/75d45bdfc9eeda15fb550e00da662c12d7d37985/pkg/kubelet/cm/container_manager_linux.go#L359-L397
setupKernelTunables() {
echo "set up kernel tunable flags..."
sudo sysctl -w vm.overcommit_memory=1
sudo sysctl -w kernel/panic=10
sudo sysctl -w kernel/panic_on_oops=1
}
1 change: 1 addition & 0 deletions parts/k8s/cloud-init/artifacts/cse_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ if [[ "${GPU_NODE}" = true ]]; then
else
cleanUpGPUDrivers
fi
setupKernelTunables
installKubeletAndKubectl
if [[ $OS != $COREOS_OS_NAME ]]; then
ensureRPC
Expand Down

0 comments on commit 83014d0

Please sign in to comment.