This document provides instructions on how to setup HA Kubernetes cluster on AWS instances using Rancher Kubernetes Engine (RKE).
This document shows how to create and configure 3 control plane VMs (each with 4 vCPUs, 16GB RAM, 80GB disk storage & Ubuntu 18.04.4) and 12 worker VMs (each with 8 vCPUs, 32GB RAM, 160GB disk storage & Ubuntu 18.04.4) through AWS and deploy with HA kubernetes cluster through RKE.
Prerequisite: Users must have AWS account credentials to login and follow the below steps in AWS EC2/VPC dashboard.
1.Create Key Pair
A Key Pair is required to access the created AWS instances and will be used by RKE to configure the VMs for Kubernetes.
If key is already exists use an existing key pair and import through Import Key Pair
- Go to AWS EC2 dashboard click on Key Pairs in the left panel then click on Actions to Import
- To Create New Key Pair:
Go to AWS EC2 dashboard click on Key Pairs in the left panel then click on Create Key Pair
Note: Keep this downloaded key safe and copied into ~/.ssh/ from which it can be referenced.
Example: mv onap-key ~/.ssh chmod 600 ~/.ssh/onap-key
2.Create VPC
Go to AWS VPC dashboard click on Your VPCs in the left panel then click on Create VPC
3.Create Subnet
Go to AWS VPC dashboard click on Subnets in the left panel then click on Create Subnet
4.Create Internet Gateway
Go to AWS VPC dashboard click on Internet Gateways in the left panel then click on Create Internet Gateway
Note: Once IGW is created, on the top right corner you will see Attach to VPC. Click on that button to attach this IGW to your VPC as below
5.Add Routes with IGW
Go to AWS VPC dashboard click on Route Tables in the left panel then select your routing table click on Routes and Edit Routes to Add route with IGW
6.Create Security Group
Click on Create Security Group under EC2>Security Groups fill the details then click create security group
Select the created security group click on edit inbound & outbound rules
Add rules for Inbound:
Click on Add rule and fill the details then click on Save Rules
Add Rules for Outbound:
Click on Edit Outbound rule and fill the details then click save rules
7.Create Kubernetes control plane VMs
Step-1: Launch new instance from EC2 and select the image, click Next
Step-2: Choose Instance Type, click Next
Step-3: Configure Instance
Select no of instances 3, network with your created VPC, subnet IDs & Enable Auto-assign Public IP then click Next