⇒ In this guide, we will walk through the step-by-step process of setting up a Kubernetes cluster on AWS EC2 instances, from launching instances to joining worker nodes to the master. This tutorial is beginner-friendly and provides a structured approach to Kubernetes setup.
Step 1: Setting Up AWS Instances
Before setting up Kubernetes, we need to launch EC2 instances on AWS.
1.1 Launch Three EC2 Instances on AWS
- Login to your AWS account.
- Go to EC2 Dashboard → Click on Launch Instance.
- Select Ubuntu (t2.medium) as the OS image.
- The Master Node must have at least 2 vCPUs and 4GB RAM for smooth operation.
- The Worker Nodes can have similar configurations.
- Launch three instances:
- 1 Master Node
- 2 Worker Nodes
1.2 Configure SSH Access
- Create a private key using
puttygen
(if using Windows) or use the AWS-provided .pem
key.
- Access the three instances using SSH (Putty on Windows, Terminal on Linux/Mac).
Step 2: Install Required Packages on All Nodes (Master & Workers)
After accessing the instances, we need to install Docker, Kubernetes, and some required dependencies.
2.1 Update System Packages
sudo su
apt-get update
This ensures all system packages are up to date.
2.2 Install HTTPS Transport Package