Enable extra flag as k8s common for both k8s master and slave:
--fail-swap-on=false
--feature-gates HugePages=false
Change-Id: I3051796bbe083011837415ab07dbb1eb68a2fb55
Signed-off-by: trevortao <trevor.tao@arm.com>
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}"
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 \