X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ffoundation%2Fscripts%2Fk8s_common.sh;h=735c307665cb2aad5cce8d59ef0392f92b28970e;hb=92fa5a0e85848c61ac4fffc7bda774a01687c2ba;hp=d9c536f26e0dfdbcee814a53ee5ccc44b7f4323b;hpb=9b5a0913db8c2306463ccf68dd8eb14ec1639d13;p=iec.git diff --git a/src/foundation/scripts/k8s_common.sh b/src/foundation/scripts/k8s_common.sh index d9c536f..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,6 +25,7 @@ rhel) ;; esac + case ${OS_ID_LIKE:-} in debian) # Install basic software @@ -88,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