Set Up GCP Load Balancer
During initial deployment, an instance group for Reblaze was created. In this step, you will attach this group to HTTP and HTTPS load balancing services as a backend of the service.
It is beyond the scope of this document to describe all the possible load balancer settings. More information about Google’s load balancing can be found at https://cloud.google.com/compute/docs/load-balancing/. If you have any questions, feel free to contact us at [email protected].
Once you set up the load balancers (LB), traffic will be routed through them to Reblaze. Using these load balancers allows GCP to create more instances as needed to handle the traffic.
For most most use cases, you will need to set up two load balancers, one for HTTP and one for HTTPS. The following steps assume that you will be setting up two load balancers. Therefore, the processes described here will be done twice, with some addition steps for HTTPS. The differences between the setup for the HTTP LB and the setup for the HTTPs LB will be noted.
- 2.When an HTTPS ( port 443 ) is required, create an additional load balancer and choose the HTTPS protocol. The steps for this are the same as creating an HTTP LB, with additional steps within the frontend configuration process.
2. Click Create load balancer.
3. Click Start configuration for the appropriate type:
- The HTTP(S) load balancer supports ports 80, 8080, and 443, (including HTTP and HTTPS) and is the appropriate type for most Reblaze customers.
- If you need non-standard ports, then use the TCP load balancer instead.
4. You will now be asked whether this load balancer is for Internet facing or internal only. Select From Internet to my VMs and click Continue. The load balancer creation page appears.
5. Enter a name for the load balancer. We recommend that you include the protocol of this load balancer as part of the name (HTTP or HTTPS), for example, LB1-http or LB2-https.
Continue to the section below: Create the Backend Service.
- 1.From the New load balancer panel on the current page, select Backend configuration > Create or select backend services & backend buckets > Backend services > Create a backend service.
2. Enter a name for the backend service. We recommend that you include the protocol of this load balancer as part of the name (HTTP or HTTPS), for example, BE1-http or BE2-https.
3. Select either HTTP or HTTPS for Protocol and Named port, depending on which protocol you are creating the LB for.
4. In the New backend fields:
- 1.Select the Instance group that was created when you deployed Reblaze in GCP. The same instance group can be used for both HTTP and HTTPS.
- 2.In the Instance group has named ports popup, make sure to select the correct port for each protocol (80 or 443). 80 is the default value.
- 3.Click Use selected port name
- 4.Select the Port numbers. Make sure that the port number selected matched the protocol that this LB is for.
- 5.For Balancing mode, select Rate, and enter 1000000 for Maximum RPS. This ensures that all servers stay available during a traffic spike unless a health check indicates otherwise.
- 6.Click Done for New backend.
5. (optional) Enable Google Cloud CDN.
7. Review the remaining values on the page to see that they are appropriate for your application environment.
8. Click Create for the backend service.
From the Edit load balancer panel on the current page, select Host and path rules.
A default host and path rule has already been created. Additional rules are optional.
- 1.From the Edit load balancer panel on the current page, select Frontend configuration.
2. Enter a name for the frontend. We recommend that you include the protocol of this load balancer as part of the name (HTTP or HTTPS), for example, FE1-http or FE2-https.
3. For Protocol, select the protocol that was created for the load balancer you are now creating (HTTP or HTTPS). HTTP is the default value.
4. For most use cases, you will want to reserve a static IP address.
If this is the first load balancer you are creating (usually HTTP), for IP address do the following:
- 1.Select Create IP address.
- 2.In the Reserve a new static IP address dialog, enter a name. The name for this IP address should not have the protocol embedded within it, since it will be the same for all load balancers that you create.
- 3.Click Reserve. GCP will reserve an IP address and it will now appear in the IP address field in the frontend configuration panel. Tip: Make a note of the IP address provided by GCP. You will need it later at the end of the configuration process.
If this is an additional LB (usually HTTPS):
- For IP address, select the IP address previously created for the first LB.
5. HTTPS only: If this load balancer is for HTTPS, you need to add or create a SSL certificate.
- 1.For Certificate, select Create a new certificate.
- 2.Enter a name for the certificate.
- 3.You can either use a certificate you already have, or create a new one:
- 4.To use an existing certificate:
- Enter the certificate information.
- Click Create for the certificate..
- 5.To create a Google-managed certificate:
- Select Create Google-managed certificate.
- Enter the domains to which this certificate will apply. Multiple domains can be entered.
- Click Create for the certificate.
- 6.Click Done in the Frontend configuration panel.
- Once you have completed all the required components for the load balancer, click Create in the Load balancer panel. The load balancer is then created. The IP address provided is the destination for your website traffic.