Would you like to learn how to install Kubernetes on Ubuntu Linux? In this tutorial, we are going to show you how to install the Kubernetes service on a computer running Ubuntu Linux.
• Ubuntu 20
• Ubuntu 19
• Ubuntu 18
• Kubernetes 1.18
In our example, The Kubernetes node IP address is 192.168.100.9.
Kubernetes – Tutorials
On this page, we offer quick access to a list of tutorials related to Kubernetes.
Tutorial Kubernetes – Installation on Ubuntu Linux
Install the list of required packages.
Install the Docker service.
Enable the Docker service during boot.
Edit the Docker service configuration file.
Add the following configuration at the end of the item named: EXECSTART
Here is the file before our configuration.
Here is the file after our configuration.
Create a System configuration file.
Here is the file content.
Enable the System configuration file.
Edit the configuration file named: MODULES.CONF
Add the following configuration at the end of this file.
Edit the FSTAB configuration file and disable the use of Swap memory.
Here is the file before our configuration.
Here is the file after our configuration.
Set a unique hostname.
Create a file to configure the required environment variables.
Here is the file content.
Reboot the computer.
Download and install the Kubernetes repository key.
Add the official Kubernetes repository.
Install the Kubernetes packages.
Download the required Kubernetes images.
Here is the command output.
Initialize the Kubernetes cluster.
Here is the command output.
Take note of the command to add nodes to the Kubernetes cluster.
Set the correct file permission on the Kubernetes configuration file.
Install the required network configuration for PODs.
Install the controller of Ingress.
By default, the Kubernetes master node is not allowed to run PODS.
Optionally, enable the Kubernetes master node to run PODS.
Congratulations! You have finished the Kubernetes installation on Ubuntu Linux.
Tutorial Kubernetes – Testing the Cluster
This is a single node cluster.
Enable the Kubernetes master to run PODS.
Create a POD using the Nginx image.
In our example, we created a POD named TEST.
Wait for the system to download the Nginx image and start the POD.
Here is the command output.
Create a YAML file with the new service configuration.
Here is the file content.
Do not change the YAML file indentation used above.
Install the new Kubernetes service.
Verify the list of Kubernetes services.
Here is the command output.
In our example, we created a new POD using the NGINX image.
In our example, we created a new service named TEST-WEB.
In our example, we exposed port 80 from our POD as the port 80 of host 192.168.100.9.
Use the CURL command to test the communication to the POD running Nginx.
Open your browser and enter the IP address of your Kubernetes server.
In our example, the following URL was entered in the Browser:
• http://192.168.100.9
The Kubernetes server will display the Nginx page.
Congratulations! You have tested your Kubernetes cluster successfully.