How To Install Kubernetes On Ubuntu 18.04 (Step by Step)
How To Install Kubernetes On Ubuntu 18.04 (Step by Step)
04 (Step by Step)
Introduction
Kubernetes is an open source platform for managing container technologies such as Docker.
Docker lets you create containers for a pre-configured image and application. Kubernetes provides the next
step, allowing you to balance loads between containers and run multiple containers across multiple systems.
This guide will walk you through how to install Kubernetes on Ubuntu 18.04.
Prerequisites
Set up Docker
Step 1: Install Docker
Kubernetes requires an existing Docker installation. If you already have Docker installed, skip ahead to Step
2.
docker ––version
Install Kubernetes
Step 3: Add Kubernetes Signing Key
Since you are downloading Kubernetes from a non-standard repository, it is essential to ensure that the
software is authentic. This is done by adding a signing key.
2. Then repeat the previous command to install the signing keys. Repeat for each server node.
kubeadm version
Note: Make sure you install the same version of each package on each machine. Different versions can create
instability. Also, this process prevents apt from automatically updating Kubernetes. For update instructions,
please see the developers’ instructions.
Kubernetes Deployment
Step 6: Begin Kubernetes Deployment
Start by disabling the swap memory on each server:
sudo swapoff –a
Next, set a worker node hostname by entering the following on the worker server:
If you have additional worker nodes, use this process to set a unique hostname on each.
Once this command finishes, it will display a kubeadm join message at the end. Make a note of the whole entry.
This will be used to join the worker nodes to the cluster.
Switch to the worker01 system and enter the command you noted from Step 7:
Replace the alphanumeric codes with those from your master server. Repeat for each worker node on the
cluster. Wait a few minutes; then you can check the status of the nodes.
The system should display the worker nodes that you joined to the cluster.
Conclusion
After following the steps mentioned in this article carefully, you should now have Kubernetes installed on
Ubuntu.
For beginners who still have no experience of deploying multiple containers, Minikube is a great way to
start. Minikube is a system for running a single node cluster locally and is excellent for learning the basics,
before moving on to Kubernetes.
This network uses multiple servers to communicate back and forth. Kubernetes allows you to launch and
manage Docker containers across multiple servers in the pod.