Created
March 23, 2020 23:54
-
-
Save PascalKu/122a01509d297a8d119fa504fc7e9519 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Docker CE | |
## Set up the repository: | |
### Install packages to allow apt to use a repository over HTTPS | |
apt-get update && apt-get install -y \ | |
apt-transport-https ca-certificates curl software-properties-common gnupg2 | |
### Add Docker’s official GPG key | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
### Add Docker apt repository. | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
## Install Docker CE. | |
apt-get update && apt-get install -y \ | |
containerd.io=1.2.10-3 \ | |
docker-ce=5:19.03.4~3-0~ubuntu-$(lsb_release -cs) \ | |
docker-ce-cli=5:19.03.4~3-0~ubuntu-$(lsb_release -cs) | |
# Setup daemon. | |
cat > /etc/docker/daemon.json <<EOF | |
{ | |
"exec-opts": ["native.cgroupdriver=systemd"], | |
"log-driver": "json-file", | |
"log-opts": { | |
"max-size": "100m" | |
}, | |
"storage-driver": "overlay2" | |
} | |
EOF | |
mkdir -p /etc/systemd/system/docker.service.d | |
# Restart docker. | |
systemctl daemon-reload | |
systemctl restart docker | |
cat <<EOF > /etc/sysctl.d/k8s.conf | |
net.bridge.bridge-nf-call-ip6tables = 1 | |
net.bridge.bridge-nf-call-iptables = 1 | |
EOF | |
sysctl --system | |
# ensure legacy binaries are installed | |
sudo apt-get install -y iptables arptables ebtables | |
# switch to legacy versions | |
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy | |
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy | |
sudo update-alternatives --set arptables /usr/sbin/arptables-legacy | |
sudo update-alternatives --set ebtables /usr/sbin/ebtables-legacy | |
sudo apt-get update && sudo apt-get install -y apt-transport-https curl | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - | |
cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list | |
deb https://apt.kubernetes.io/ kubernetes-xenial main | |
EOF | |
sudo apt-get update | |
sudo apt-get install -y kubelet kubeadm kubectl | |
sudo apt-mark hold kubelet kubeadm kubectl | |
systemctl daemon-reload | |
systemctl restart kubelet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment