Skip to content

Instantly share code, notes, and snippets.

@Ameausoone
Last active June 3, 2019 12:07
Show Gist options
  • Save Ameausoone/748ed00a3365405dda2c2d7db7493036 to your computer and use it in GitHub Desktop.
Save Ameausoone/748ed00a3365405dda2c2d7db7493036 to your computer and use it in GitHub Desktop.
#!/bin/bash
# to run this script just run this with root
# curl -sfL https://gist.github.com/Ameausoone/748ed00a3365405dda2c2d7db7493036/raw/install-k8s-single-node-ubuntu.sh | sh -
set -eux pipefail
# Install Docker CE
## Set up the repository:
### Install packages to allow apt to use a repository over HTTPS
apt-get update && apt-get install apt-transport-https ca-certificates curl software-properties-common
### 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 install -y docker.io
# Restart docker.
systemctl daemon-reload
systemctl enable docker.service
systemctl restart docker
# Install Kubeadm
apt-get update && apt-get install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y kubelet kubeadm kubectl
apt-mark hold kubelet kubeadm kubectl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment