3 DOCKER_VERSION=18.06.1~ce~3-0~ubuntu
5 K8S_CNI_VERSION=0.6.0-00
7 # Install Docker as Prerequisite
8 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
9 sudo apt-key fingerprint 0EBFCD88
10 sudo add-apt-repository \
11 "deb https://download.docker.com/linux/ubuntu \
15 sudo apt install -y docker-ce=${DOCKER_VERSION}
17 # Disable swap on your machine
20 # Install Kubernetes with Kubeadm
22 sudo apt install -y apt-transport-https curl
23 curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
25 cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
26 deb https://apt.kubernetes.io/ kubernetes-xenial main
29 # Minor fix for broken kubernetes-cni dependency in upstream xenial repo
31 kubernetes-cni=${K8S_CNI_VERSION} kubelet=${KUBE_VERSION} kubeadm=${KUBE_VERSION} kubectl=${KUBE_VERSION}
32 sudo apt-mark hold kubernetes-cni kubelet kubeadm kubectl
34 #Add extra flags to Kubelet
35 if ! grep -q -e 'fail-swap-on' /etc/default/kubelet; then
36 sudo sed 's/KUBELET_EXTRA_ARGS=/KUBELET_EXTRA_ARGS=--fail-swap-on=false --feature-gates HugePages=false/' -i /etc/default/kubelet
39 _conf='/etc/sysctl.d/99-akraino-iec.conf'
40 echo 'net.bridge.bridge-nf-call-iptables = 1' |& sudo tee "${_conf}"
41 sudo sysctl -q -p "${_conf}"