X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ffoundation%2Fscripts%2Fk8s_common.sh;h=735c307665cb2aad5cce8d59ef0392f92b28970e;hb=92fa5a0e85848c61ac4fffc7bda774a01687c2ba;hp=975b43cb029aaa0dd3258bdad556312e0a295161;hpb=be9696bf4729b94cb79d79bdc8e8549a913302a1;p=iec.git diff --git a/src/foundation/scripts/k8s_common.sh b/src/foundation/scripts/k8s_common.sh index 975b43c..735c307 100755 --- a/src/foundation/scripts/k8s_common.sh +++ b/src/foundation/scripts/k8s_common.sh @@ -9,14 +9,14 @@ fi case ${OS_ID_LIKE:-} in debian) DOCKER_VERSION=18.06.1~ce~3-0~ubuntu - KUBE_VERSION=1.13.0-00 - K8S_CNI_VERSION=0.6.0-00 + KUBE_VERSION=${1:-1.13.0}-00 + K8S_CNI_VERSION=${2:-0.6.0}-00 KUBELET_CFG=/etc/default/kubelet ;; rhel) DOCKER_VERSION=18.06.1.ce-3.el7 - KUBE_VERSION=1.13.0-0 - K8S_CNI_VERSION=0.6.0-0 + KUBE_VERSION=${1:-1.13.0}-0 + K8S_CNI_VERSION=${2:-0.6.0}-0 KUBELET_CFG=/etc/sysconfig/kubelet ;; *) @@ -25,14 +25,16 @@ rhel) ;; esac + case ${OS_ID_LIKE:-} in debian) # Install basic software + echo "Acquire::ForceIPv4 \"true\";" | sudo tee -a /etc/apt/apt.conf.d/99force-ipv4 > /dev/null sudo apt update sudo apt install -y software-properties-common apt-transport-https curl # Install Docker as Prerequisite - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + curl -4fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo apt-key fingerprint 0EBFCD88 sudo add-apt-repository \ "deb https://download.docker.com/linux/ubuntu \ @@ -87,8 +89,10 @@ EOF esac # Add extra flags to Kubelet -if ! grep -q -e 'fail-swap-on' $KUBELET_CFG; then - sudo sed 's/KUBELET_EXTRA_ARGS=/KUBELET_EXTRA_ARGS=--fail-swap-on=false --feature-gates HugePages=false/' -i $KUBELET_CFG +if [ ! -f "$KUBELET_CFG" ]; then + echo 'KUBELET_EXTRA_ARGS=--fail-swap-on=false' | sudo tee $KUBELET_CFG > /dev/null +elif ! grep -q -e 'fail-swap-on' $KUBELET_CFG; then + sudo sed 's/KUBELET_EXTRA_ARGS=/KUBELET_EXTRA_ARGS=--fail-swap-on=false/' -i $KUBELET_CFG fi sudo systemctl enable docker kubelet