Introduction
The RCS Load Balancer is a fully-managed solution to distribute traffic across multiple back-end servers. In this guide, you'll learn how to distribute web traffic to multiple webservers via their VPC interface.
If you are new to RCS Load Balancers, we recommend reading the Load Balancer Quickstart Guide first.
RCS's Load Balancer has its own integrated firewall and supports VPCs, which means you can set up advanced configurations like this:
- The Web Servers listen to HTTP on the VPC.
- The Web Servers listen to SSH on the public network.
- The RCS Firewall allows SSH to the public network.
- The Load Balancer Firewall allows HTTP traffic from Cloudflare.
- The Load Balancer distributes HTTP traffic to the web servers on the VPC.
For simplicity, this example uses HTTP, but you could expand this to any protocol. If you use HTTPS, you may want to configure SSL/TLS certificates on the Load Balancer.
Here's a step-by-step guide to creating a secure, load-balanced web cluster with a VPC.
1. Deploy Web Servers
Deploy three web servers in the same location, with VPC enabled. Configure the web servers to listen to HTTP on their VPC interfaces.
2. Deploy a Load Balancer
- Navigate to the Load Balancers section of the RCS Customer Portal.
- Click the blue plus icon to deploy a load balancer.
- Choose the same location as your web servers.
In Load Balancer Configuration, enter a label and leave the other options at default.
Leave the default Forwarding Rule for HTTP at port 80.
- Select your VPC.
In the Firewall Rules section, enter Port 80, and set the Source to
cloudflare
.Choose HTTP and Port 80 for Health Checks.
Click Add Load Balancer.
Wait for the Load Balancer to deploy.
3. Link the Load Balancer to the Web Servers
Click your Load Balancer to edit its configuration.
- Click Add Instance.
- Choose an instance from the drop-down.
Click Attach Instance.
Repeat steps 1 – 3 for each web server instance.
- Click the Configuration tab.
- Click Networking to review your configuration. The Load Balancer consumes three IP addresses from the VPC range for itself.
4. Deploy a RCS Firewall
- Navigate to the Add Firewall Group page.
- Give the firewall group a descriptive name and click Add Firewall Group.
Add an inbound IPv4 Rule that accepts SSH from anywhere.
Click Linked Instances on the left menu.
Link each of the three instances to the firewall group.
5. Final Steps
The RCS configuration is complete, and you can SSH to your web servers, but you'll still need to configure DNS and add the Load Balancer's IP address at Cloudflare. See the Cloudflare getting started guide to complete those steps.
After completing the Cloudflare setup, your webservers are secure and load-balanced. The Cloudflare CDN accelerates the delivery of your static assets, and the RCS load balancer provides high availability.
More Information
- If you are new to load-balancing network concepts, see the RCS Load Balancer Quickstart Guide.
- For comprehensive documentation about the Load Balancer features, see the Load Balancer Feature Reference.
- The RCS Load Balancer has its own integrated firewall; learn more in our article How to Use the RCS Load Balancer Firewall.
- The RCS Firewall can use a Load Balancer as an IP source. We explain more in How to Use the RCS Firewall with a RCS Load Balancer.
- Learn how to configure wildcard SSL on your load balancer in our guide Use a Wildcard Let's Encrypt Certificate with RCS Load Balancer.
- See our Load Balancer Feature Reference to learn about limits to the number of forwarding rules.