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