Loadbalancer Setup
(WIP)
Introduction
Load balancing in Kubernetes (K8s) is essential to ensure high availability, scalability, and reliability of applications running within the cluster. It involves distributing incoming network traffic across multiple pods or nodes to optimise resource utilisation and prevent any single point of failure.
Installation on AWS
Follow the steps below to create a load balancer on AWS.
Note: The naming conventions may vary depending on the environment.
Creating Target Group for http
Creating Target Group for https-redirect
Creating Target Group for PostgreSQL
Creating Network Load Balancer
Creating Target Group for http
In the EC2 dashboard, under the "Load Balancing" section, select "Target Groups" from the menu.
Click the "Create Target Group" button to create a new Target Group.
Configure Target Group
Choose target type -
Instance
Target Group name -
openg2p-<envname>-http
Protocol : Port -
TCP : 30080
VPC - Select the VPC in which the instances are located
Health check protocol : Path : Port (Traffic Port) -
HTTP : /healthz/ready : 30521
Register Targets
After configuring the Target Group, click the "Next" button
Select the targets (instances) to register with the Target Group
Click the "Add to registered" button to add the selected targets to the Target Group
Review the configuration settings for the Target Group. After verification, click the "Create Target Group" button to create the Target Group.
Once the Target Group is created, make a note of the Amazon Resource Name (ARN) of the newly created Target Group. This ARN is required when you configure Load Balancers or other services that use the Target Group.
Creating Target Group for https-redirect
To create a Target Group for "https-redirect," follow the same steps mentioned above. Only for the "Configure Target Group" section, use the following configurations.
Choose target type -
Instance
Target Group name -
openg2p-<envname>-httpsredirect
Protocol : Port -
TCP : 30081
VPC - Select the VPC in which the instances are located
Health check protocol : Path : Port (Overide) -
HTTP : /healthz/ready : 30521
Creating a Target Group for PostgreSQL
To create a Target Group for "PostgreSQL," follow the same steps mentioned above. Only for the "Configure Target Group" section, use the following configurations.
Choose target type -
Instance
Target Group name -
openg2p-<envname>-postgres
Protocol : Port -
TCP : 32432
VPC - Select the VPC in which the instances are located
Health check protocol : Path : Port (Overide) -
HTTP : /healthz/ready : 30521
Creating Network Load Balancer
In the EC2 dashboard, click the "Load Balancers" tab and then click "Create Load Balancer" and Choose Load Balancer Type as Network Load Balancer.
Configure Load Balancer Settings
Create NLB with name -
openg2p-<envname>
Select VPC - Select the VPC and region in which the instances are located
Select Security Group - Select the Security Group in which the instances are located
Note: Click here to create Security Group, if required
Configure Routing - Define Target Groups to route traffic to specific instances
Listeners and routing Protocol : Port : Default action
Note: Below default action, select the Target Groups already created from the above steps.
TLS : 443 : openg2p-<envname>-http
TCP : 80 : openg2p-<envname>-httpsredirect
Select
ACM certificate
as per environment domain name and create NLB.Note: Click here to create ACM certificate, if required
Review the configuration settings and create the Load Balancer
Installation on-prem
Last updated