AWS Setup for Hands-On Labs
Before creating a multi-node Kubernetes cluster on AWS, configure the foundational cloud infrastructure:
1. Infrastructure Specifications
Section titled “1. Infrastructure Specifications”For a resilient multi-node test or staging environment:
- 1 Control Plane Instance:
t3.medium(2 vCPU, 4 GB RAM, 20 GB gp3 SSD). - 2 Worker Node Instances:
t3.medium(2 vCPU, 4 GB RAM, 30 GB gp3 SSD). - OS Image: Ubuntu 22.04 LTS / 24.04 LTS (x86_64).
2. Security Group Port Configurations
Section titled “2. Security Group Port Configurations” ┌────────────────────────────────────────────────────────────────────────┐ │ CONTROL PLANE INBOUND RULES │ │ - Port 6443 TCP : Kubernetes API Server (Worker nodes & admin IPs) │ │ - Port 2379-2380 : etcd client & peer communication (Control plane) │ │ - Port 10250 TCP : Kubelet API (API Server to Kubelet) │ │ - Port 10259 TCP : kube-scheduler metrics │ │ - Port 10257 TCP : kube-controller-manager metrics │ ├────────────────────────────────────────────────────────────────────────┤ │ WORKER NODE INBOUND RULES │ │ - Port 10250 TCP : Kubelet API (Self & Control plane) │ │ - Port 30000-32767: NodePort Services (External traffic) │ │ - Port 4789/8472 : Flannel/Calico VXLAN Overlay network traffic │ └────────────────────────────────────────────────────────────────────────┘3. Disabling Swap (Required for Kubelet)
Section titled “3. Disabling Swap (Required for Kubelet)”Kubernetes requires swap to be permanently disabled on all nodes:
# Temporarily disable swapsudo swapoff -a
# Permanently disable swap in /etc/fstabsudo sed -i '/ swap / s/^/#/' /etc/fstab