Create a Load Balancer
To create a Load Balancer, you have to configure key options like name, region, forwarding rules, CPU Nodes and VPC connection.
Select the region where you want the Load Balancer to be deployed. The region is important for minimizing latency and ensuring that the traffic is routed efficiently. For example, if most of your users are in Brazil, you should choose a region close to them. This will help improve response times and performance. If you operate globally, you may want to have multiple replicas running at the same time.
The next step is to decide how many instances running in parallel you want. This ensures redundancy and higher availability. Having multiple replicas can protect you in case one instance goes down. For most use cases, starting with a single replica is a good balance between cost and availability. Having at least two replicas running adds High availability parameter to the Load Balancer.
Next, you’ll need to connect at least two CPU Nodes to the Load Balancer. CPU Nodes have to be already in "Running" status to be listed for connection. These CPU Nodes will be responsible for processing the incoming requests distributed by the Load Balancer. It requires a minimum of two CPUs to ensure proper balancing. You can connect more CPU Nodes as needed based on your traffic demand. This step is critical as the Load Balancer relies on these CPUs to handle traffic efficiently.
You have the option to connect a VPC to the Load Balancer. This step is optional, but if you want to segment your network and ensure that traffic flows through a specific virtual network, connecting a VPC is recommended. This allows you to isolate traffic within a particular network, which can enhance security and control.
Once these are set up, you may proceed to the forwarding rules. Forwarding rules tell the Load Balancer how to route incoming traffic. These rules can be defined based on factors like the protocol (HTTP or HTTPS) or specific port (80 or 443). Forwarding rules help optimize the flow of requests and ensure that each CPU Node gets the right kind of traffic for the work it is handling.
Some forwarding rules may optionally accept or require a certificate to secure the connection. A certificate contains a public and a private part.
After configuring these options Load Balancer is ready to deploy. Once it enters "Running" status, it will begin distributing traffic according to your configuration, providing a reliable and efficient way to manage the load across your CPU Nodes.