Put an external Application Load Balancer (ALB) in front of a website on one of your nodes, then open the website through the load balancer’s own public IP. Once this works, adding more servers or HTTPS is a change to the same load balancer.
You need:
- A node in Delhi or Chennai that reads Running, in the region where you will create the load balancer. See Get started with Node.
- A website on the node that listens on its private IP, on a port you know, such as 80, and answers
a
HEADrequest for/with a success or redirect status, such as 200 OK or 301. A website that listens only onlocalhostis out of the load balancer’s reach. The load balancer checks the node this way and sends traffic only while the check passes. - A security group on the node that allows inbound TCP on the website’s port. See Add or edit rules.
- Enough balance or infra credits for the plan you choose. See Your balance cannot cover the plan.
- Create permission for Load Balancers in the project.
To check the website the way the load balancer will, sign in to the node and run this command.
<node-private-ip> is the node’s private IP, shown in the nodes list, and <port> is the website’s
port:
curl -I -H "Host: localhost" http://<node-private-ip>:<port>/The first line shows the status. A status in the 200s or 300s means the node will pass the check:
HTTP/1.1 200 OKChoose a plan
Section titled “Choose a plan”-
In MyAccount, under Compute, click Load Balancers. Click +, or Get Started if you have no load balancer yet.
-
On Plan, click a plan. The table lists each plan’s vCPU, RAM, Max Concurrent Connections, and Price per hour and per month. Start with the smallest plan, E2E-LB-2, with 4 vCPU and 6 GB RAM. On hourly billing, you can move to a larger plan later, after you power off the load balancer.
If every plan shows Request in place of Select, see Every plan shows Request in place of Select.
-
Under —Choose Hourly / Committed LB—, choose Hourly Billed, and click Next.
Choose the type and the details
Section titled “Choose the type and the details”- On Type, click Application Load Balancer (ALB). The next step opens.
- On Details, keep the suggested Name, or enter your own.
- Keep Scheme on External (with public IP) - Distributes traffic from external sources.
- Set Frontend Protocol to HTTP. The load balancer then listens on port 80, and needs no certificate. Click Next.
Add your node as a backend server
Section titled “Add your node as a backend server”On Target Mapping, keep the starting values: Backend Protocol on HTTP, Health Check ticked, Routing Policy on Source IP Hash, and Backend Type on Node.
- Beside Backend Servers, click Add Server.
- In Server Name, start typing the node’s name, and pick the node. Server IP fills in. Check that it is the node’s private IP, the address the load balancer reaches the node on.
- In Server Port, enter the website’s port, and click Submit. The node joins Backend Servers.
- Click Next.
Launch the load balancer
Section titled “Launch the load balancer”- On Peak Performance Features, keep the defaults. Under Security Group, your project’s default security group is chosen. Check that its rules allow inbound TCP on port 80 from your users, or choose another group that does; see Add or edit rules. Click Next.
- On Summary, check your choices, and click Launch Load Balancer.
MyAccount returns you to the Load Balancers list, where your load balancer reads Creating. With Frontend Protocol on HTTP, as here, it reads Running about four to seven minutes after you launch it.
If it reads Backend Connection Failure instead, check the node with the steps in The load balancer shows Backend Connection Failure.
Open your website through the load balancer
Section titled “Open your website through the load balancer”In the Load Balancers list, copy the load balancer’s Public IP. Open this address in a
browser, where <load-balancer-ip> is that IP:
http://<load-balancer-ip>/Your website opens, served by your node through the load balancer. To see the server’s health, click the load balancer in the list and open its Backend Mapping tab, which lists your server with its IP and port.
(Optional) Point your domain at the load balancer
Section titled “(Optional) Point your domain at the load balancer”To reach the website by name, add an A record for your domain at your DNS provider, with the load
balancer’s Public IP as its value. Once the record is live, open your domain over http://.
Clean up
Section titled “Clean up”A load balancer is billed by the minute from when you create it until you delete it, and also while it is powered off. When you have finished trying it, delete it; see Delete a load balancer. Your node is a separate product with its own charges.
What to do next
Section titled “What to do next”- Manage backend groups and servers: add more nodes, and choose the health check and the routing policy.
- Add an SSL certificate: serve your website over HTTPS.
- Route requests with ACL rules: send different paths or domains to different servers.
- Create an Application Load Balancer: every choice in the create flow, including a VPC, encryption, and timeouts.
- Troubleshooting Load Balancer and Load Balancer FAQ: fixes for common problems, and short answers.