Uploaded November 2021 | Updated September 2026, 2 weeks ago
This tutorial explains how to set up your Kubernetes cluster on Ubuntu 18.04 server. For this example I use AWS EC2 (Cloud Computing Service from Amazon Web Service), but the provided steps are applicable for any Ubuntu 18.04 environment. This tutorial begins on how to prepare your EC2 instances, then run it all and connect to all these from your local machine - in my case, I used MacOS. If you are Windows user, for this step you can use PuTTy service.
For this example, I will create 1 Master node and 2 Worker nodes (in total 3 instances, or 3 nodes) for my Kubernetes Cluster. Also, I am sharing all related links to resources which helped and were useful in preparing this tutorial. There are many tutorials and instructions how to set up Kubernetes, but I tried to prepare the best one! So, in total - 33 commands and 9 steps for Kubernetes installations, everything is for you.
The plan of attack / Steps to Set up your Kubernetes cluster are:
0:00 - Intro
0:10 - Step 1. Set Up AWS EC2 Ubuntu 18.04 Instance
3:33 - Step 2. Connect to EC2 Instances from local terminals
4:34 - 2.1. Make your private key (.pem) executable
5:18 - 2.2. Connect to all nodes from instances
6:44 - Step 3. Install dependencies and configure Kubernetes
7:01 - 3.1. Update the package list
7:39 - 3.2. Install Docker
8:56 - 3.3. Check Docker version
9:32 - 3.4. Start and enable Docker
11:10 - Step 4. Install Kubernets on Ubuntu 18.04
11:20 - 4.1. Add a Signing Key (GPG)
12:24 - 4.2. Add the Kubernetes software repository
13:14 - Step 5. Prepare Kubernetes installation tools
13:35 - 5.1. Install kubeadm, kubelet, and kubectl
14:57 - 5.2. Check if kubeadm, kubelet, and kubectl are on hold
15:49 - 5.3. Check kubeadm version
16:30 - Step 6. Kubernetes Deployment
16:40 - 6.1. Disable the swap memory from nodes
17:03 - 6.2. Set host names for each node
18:20 - Step 7. Workaround to avoid mismatches between Docker drivers
19:04 - 7.1. Create a daemon.json file
22:20 - 7.2. Reset Docker and kubeadm services
23:44 - Step 8. Initialize Kubernetes Pod Network
24:16 - 8.1. Set up a Pod Network for Master node
26:44 - 8.2. Create a directory for the initialized Master node
27:05 - NETWORK ISSUES - you can skip it
28:16 - 8.3.Set up a virtual network for communication across nodes (flannel)
29:04 - 8.4. Check the pods status
29:30 - 8.5. Join Worker nodes to a Master node
30:34 - Step 9. Check final stages
30:55 - 9.1. Confirm that Master node communicates with all Worker nodes
31:47 - BONUS: Github repository - Readme file with all steps in one place
- - - - - - - - - -
Additional resources:
- You can find all steps provided in this video clearly explained in Readme right here: Github repo with all steps: github.com/vb100/Deploy_Kubernetes_AWS_EC2/blob/main/README.md
- How to set up AWS EC2 and run Python scripts (step by step example): youtu.be/qUHQuZjTOFA
- Download PuTTy for Windows: putty.org
- More about workaround step (7): github.com/kubernetes/kubernetes/issues/75803
- Kubernetes networking model: ibm.com/docs/en/cloud-private/3.1.2?topic=networking-kubernetes-network-model
- What is a Pod in Kubernetes: w3schools.com/html/html_images.asp
I hope that this tutorial was not too long (if yes, let me know, I will do shorter in future). Also, any feedbacks and comments are welcome!
Vytautas - Data Science Garage.
#kubernetes #docker #devops
This tutorial explains how to set up your Kubernetes cluster on Ubuntu 18.04 server. For this example I use AWS EC2 (Cloud Computing Service from Amazon Web Service), but the provided steps are applicable for any Ubuntu 18.04 environment. This tutorial begins on how to prepare your EC2 instances, then run it all and connect to all these from your local machine - in my case, I used MacOS. If you are Windows user, for this step you can use PuTTy service.
For this example, I will create 1 Master node and 2 Worker nodes (in total 3 instances, or 3 nodes) for my Kubernetes Cluster. Also, I am sharing all related links to resources which helped and were useful in preparing this tutorial. There are many tutorials and instructions how to set up Kubernetes, but I tried to prepare the best one! So, in total - 33 commands and 9 steps for Kubernetes installations, everything is for you.
The plan of attack / Steps to Set up your Kubernetes cluster are:
0:00 - Intro
0:10 - Step 1. Set Up AWS EC2 Ubuntu 18.04 Instance
3:33 - Step 2. Connect to EC2 Instances from local terminals
4:34 - 2.1. Make your private key (.pem) executable
5:18 - 2.2. Connect to all nodes from instances
6:44 - Step 3. Install dependencies and configure Kubernetes
7:01 - 3.1. Update the package list
7:39 - 3.2. Install Docker
8:56 - 3.3. Check Docker version
9:32 - 3.4. Start and enable Docker
11:10 - Step 4. Install Kubernets on Ubuntu 18.04
11:20 - 4.1. Add a Signing Key (GPG)
12:24 - 4.2. Add the Kubernetes software repository
13:14 - Step 5. Prepare Kubernetes installation tools
13:35 - 5.1. Install kubeadm, kubelet, and kubectl
14:57 - 5.2. Check if kubeadm, kubelet, and kubectl are on hold
15:49 - 5.3. Check kubeadm version
16:30 - Step 6. Kubernetes Deployment
16:40 - 6.1. Disable the swap memory from nodes
17:03 - 6.2. Set host names for each node
18:20 - Step 7. Workaround to avoid mismatches between Docker drivers
19:04 - 7.1. Create a daemon.json file
22:20 - 7.2. Reset Docker and kubeadm services
23:44 - Step 8. Initialize Kubernetes Pod Network
24:16 - 8.1. Set up a Pod Network for Master node
26:44 - 8.2. Create a directory for the initialized Master node
27:05 - NETWORK ISSUES - you can skip it
28:16 - 8.3.Set up a virtual network for communication across nodes (flannel)
29:04 - 8.4. Check the pods status
29:30 - 8.5. Join Worker nodes to a Master node
30:34 - Step 9. Check final stages
30:55 - 9.1. Confirm that Master node communicates with all Worker nodes
31:47 - BONUS: Github repository - Readme file with all steps in one place
- - - - - - - - - -
Additional resources:
- You can find all steps provided in this video clearly explained in Readme right here: Github repo with all steps: github.com/vb100/Deploy_Kubernetes_AWS_EC2/blob/main/README.md
- How to set up AWS EC2 and run Python scripts (step by step example): youtu.be/qUHQuZjTOFA
- Download PuTTy for Windows: putty.org
- More about workaround step (7): github.com/kubernetes/kubernetes/issues/75803
- Kubernetes networking model: ibm.com/docs/en/cloud-private/3.1.2?topic=networking-kubernetes-network-model
- What is a Pod in Kubernetes: w3schools.com/html/html_images.asp
I hope that this tutorial was not too long (if yes, let me know, I will do shorter in future). Also, any feedbacks and comments are welcome!
Vytautas - Data Science Garage.
#kubernetes #docker #devops










