-DOCKER_VERSION=18.06.1~ce~3-0~ubuntu
-KUBE_VERSION=1.13.0-00
-K8S_CNI_VERSION=0.6.0-00
-
-# Install basic software
-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 -
-sudo apt-key fingerprint 0EBFCD88
-sudo add-apt-repository \
- "deb https://download.docker.com/linux/ubuntu \
- $(lsb_release -cs) \
- stable"
-sudo apt update
-sudo apt install -y docker-ce=${DOCKER_VERSION}
+if grep -q -e rhel /etc/*-release; then
+ OS_ID_LIKE=rhel
+elif grep -q -e debian /etc/*-release; then
+ OS_ID_LIKE=debian
+fi
+
+case ${OS_ID_LIKE:-} in
+debian)
+ DOCKER_VERSION=18.06.1~ce~3-0~ubuntu
+ KUBE_VERSION=${1:-1.15.0}-00
+ K8S_CNI_VERSION=${2:-0.7.5}-00
+ KUBELET_CFG=/etc/default/kubelet
+ ;;
+rhel)
+ DOCKER_VERSION=18.06.1.ce-3.el7
+ KUBE_VERSION=${1:-1.15.0}-0
+ K8S_CNI_VERSION=${2:-0.7.5}-0
+ KUBELET_CFG=/etc/sysconfig/kubelet
+ ;;
+*)
+ echo 'Unsupported distribution detected!'
+ exit 1
+ ;;
+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 python-pip
+
+ # Install Docker as Prerequisite
+ 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 \
+ $(lsb_release -cs) \
+ stable"
+ sudo apt update
+ sudo apt install -y docker-ce=${DOCKER_VERSION}
+ ;;
+rhel)
+ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
+ sudo yum-config-manager --add-repo \
+ https://download.docker.com/linux/centos/docker-ce.repo
+ sudo yum install -y \
+ docker-ce-$DOCKER_VERSION \
+ docker-ce-cli-$DOCKER_VERSION \
+ containerd.io
+ ;;
+esac