Skip to content

Instantly share code, notes, and snippets.

@RagedUnicorn
Last active July 25, 2018 17:08
Show Gist options
  • Save RagedUnicorn/9399e2dc585d9115e6bf2e85f54d1000 to your computer and use it in GitHub Desktop.
Save RagedUnicorn/9399e2dc585d9115e6bf2e85f54d1000 to your computer and use it in GitHub Desktop.
Install kubernetes on ubuntu

Kubernetes Ubuntu Installation

Init

Update package index

sudo apt-get update

Install required packages

sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common

Install Docker

Install docker gpg key then add the docker repository

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable"

Update package index and install specific docker version

sudo apt update

sudo apt-get install -y docker-ce=$(apt-cache madison docker-ce | grep 17.03 | head -1 | awk '{print $3}')

Add ubuntu to docker group and check installed version

sudo adduser ubuntu docker

docker version

Install Kubernetes

Install kubernetes gpg key and add the kubernetes repository

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

sudo add-apt-repository "deb http://apt.kubernetes.io/ kubernetes-$(lsb_release -cs) main"

Update package index and install kubelet, kubeadm and kubectl

sudo apt update

sudo apt install -y kubelet kubeadm kubectl

Check installation

kubelet --version
kubectl version
kubeadm version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment