splitting config to appropriate script

This commit is contained in:
David Lyle
2019-09-13 17:36:38 -05:00
committed by Obed N Munoz
parent b476b5d6e5
commit 43a402e45b
2 changed files with 18 additions and 12 deletions
+17
View File
@@ -8,6 +8,7 @@ CUR_DIR=$(pwd)
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
: ${TOKEN:=}
: ${MASTER_IP:=}
HIGH_POD_COUNT=${HIGH_POD_COUNT:-""}
function print_usage_exit() {
exit_code=${1:-0}
@@ -37,6 +38,16 @@ function cluster_init() {
if ! [ -z ${MASTER_IP} ]; then
sed -i "/InitConfiguration/a localAPIEndpoint:\\n advertiseAddress: ${MASTER_IP}" ./kubeadm.yaml
fi
if [[ -n "${HIGH_POD_COUNT}" ]]; then
# increase the address range per node
cat <<EOT >> kubeadm.yaml
controllerManager:
extraArgs:
node-cidr-mask-size: "20"
EOT
fi
#This only works with kubernetes 1.12+. The kubeadm.yaml is setup
#to enable the RuntimeClass featuregate
if [[ -d /var/lib/etcd ]]; then
@@ -63,6 +74,12 @@ function cluster_init() {
if [ "$(kubectl get nodes | wc -l)" -eq 2 ]; then
kubectl taint nodes --all node-role.kubernetes.io/master-
fi
if [[ -n "${HIGH_POD_COUNT}" ]]; then
# increase limits in kubelet
sudo sed -i 's/^maxPods\:.*/maxPods\: 5000/' /var/lib/kubelet/config.yaml
sudo sed -i 's/^maxOpenFiles\:.*/maxOpenFiles\: 1048576/' /var/lib/kubelet/config.yaml
fi
}
function kata() {
+1 -12
View File
@@ -103,7 +103,7 @@ fs.inotify.max_queued_events=1048576
fs.inotify.max_user_watches=1048576
fs.inotify.max_user_instances=1048576
EOT
sudo sysctl -p
sudo sysctl -q -p
# write configuration files
sudo mkdir -p /etc/systemd/system/kubelet.service.d
@@ -116,17 +116,6 @@ EOT
sudo mkdir -p /etc/systemd/system/crio.service.d
write_limits_conf "/etc/systemd/system/crio.service.d/limits.conf"
fi
# increase limits in kubelet
sudo sed -i 's/^maxPods\:.*/maxPods\: 5000/' /var/lib/kubelet/config.yaml
sudo sed -i 's/^maxOpenFiles\:.*/maxOpenFiles\: 1048576/' /var/lib/kubelet/config.yaml
# increase the address range per node
cat <<EOT >> kubeadm.yaml
controllerManager:
extraArgs:
node-cidr-mask-size: "20"
EOT
}
# daemon reload