Friday, February 9, 2024

Install Kubernetes On Ubuntu

Set up Docker

note: Kubernetes requires a CRI (Container Runtime Interface) such as Docker, containerd, or CRI-O.

1) Update the package list:

$ sudo apt update

2) Install Docker with the following command:

$ sudo apt install docker.io -y

3) Set Docker to launch on boot by entering:

$ sudo systemctl enable docker

4) Verify Docker is running:


$ sudo systemctl status docker
$ sudo systemctl start docker
$ sudo systemctl enable docker


Install Kubernetes

Step 1: Add Kubernetes Signing Key

$ curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes.gpg

Step 2: Add Software Repositories

$ echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/kubernetes.gpg] http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list

$ sudo apt update

Step 3: Install Kubernetes Tools

  • Kubeadm: A tool that initializes a Kubernetes cluster by fast-tracking the setup using community-sourced best practices.
  • Kubelet: The work package that runs on every node and starts containers. The tool gives you command-line access to clusters.
  • Kubectl: The command-line interface for interacting with clusters.


$ sudo apt install kubeadm kubelet kubectl

2. Mark the packages as held back to prevent automatic installation, upgrade, or removal:

$ sudo apt-mark hold kubeadm kubelet kubectl

3. Verify the installation with:

$ kubeadm version

No comments:

Post a Comment

testing