From: Trevor Tao Date: Mon, 25 Mar 2019 08:42:43 +0000 (+0000) Subject: Merge "Enable extra flag for both master and nodes" X-Git-Tag: 1.0.0~35 X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=e2db2e70f8c797b709189cb4f38519e47c0b8975;hp=566d134528a145793f3c19bcbf6ec2fcc13ce332;p=iec.git Merge "Enable extra flag for both master and nodes" --- diff --git a/src/foundation/scripts/k8s_common.sh b/src/foundation/scripts/k8s_common.sh index 9a44834..e1e086d 100755 --- a/src/foundation/scripts/k8s_common.sh +++ b/src/foundation/scripts/k8s_common.sh @@ -29,6 +29,11 @@ sudo apt install -y \ kubelet=${KUBE_VERSION} kubeadm=${KUBE_VERSION} kubectl=${KUBE_VERSION} sudo apt-mark hold kubelet kubeadm kubectl +#Add extra flags to Kubelet +if ! grep -q -e 'fail-swap-on' /etc/default/kubelet; then + sudo sed 's/KUBELET_EXTRA_ARGS=/KUBELET_EXTRA_ARGS=--fail-swap-on=false --feature-gates HugePages=false/' -i /etc/default/kubelet +fi + _conf='/etc/sysctl.d/99-akraino-iec.conf' echo 'net.bridge.bridge-nf-call-iptables = 1' |& sudo tee "${_conf}" sudo sysctl -q -p "${_conf}" diff --git a/src/foundation/scripts/k8s_master.sh b/src/foundation/scripts/k8s_master.sh index 5eb9082..1782769 100755 --- a/src/foundation/scripts/k8s_master.sh +++ b/src/foundation/scripts/k8s_master.sh @@ -10,9 +10,6 @@ if [ -z "${MGMT_IP}" ]; then exit 1 fi -#Add extra flags to Kubelet -sed '/Environment=\"KUBELET_CONFIG_ARGS/a\Environment=\"KUBELET_EXTRA_ARGS=--fail-swap-on=false --feature-gates HugePages=false\"' -i /etc/systemd/system/kubelet.service.d/10-kubeadm.conf - if ! kubectl get nodes; then sudo kubeadm config images pull sudo kubeadm init \