Configuring a secure Load Balancer with Let's Encrypt
Objective
Our Public Cloud Load Balancer is based on OpenStack Octavia and is fully integrated into the Public Cloud universe.
After setting up your Load Balancer, you can configure it with a certificate in order to process HTTPS connections.
This tutorial explains how to configure a secure Public Cloud Load Balancer with Let's Encrypt.
Requirements
- A Public Cloud project in your OVHcloud account
- Preparing your environment for using the OpenStack API
- OpenStack Octavia client and OpenStack Barbican set up
- A Load Balancer running in your project
If you are not yet familiar with creating a Load Balancer, please follow our guide on Getting started with Load Balancer on Public Cloud before you continue with this tutorial.
Instructions
Creating an instance for Let's Encrypt
You can create an instance in your project in the region where your Load Balancer is located. Read about the details in our guide if necessary. The d2-2 instance type will be sufficient for this operation. We recommend that you use Ubuntu as your operating system.
Once you have created your instance, you can refer to the Let's Encrypt documentation to install Certbot.
Attaching a Floating IP address to a Load Balancer
This is how to attach a Floating IP address to a Load Balancer:
To retrieve the VIP port ID of your Load Balancer, use openstack loadbalancer show my_load_balancer.
Please note that you must add an A record in the DNS Zone of your domain name that points to the Floating IP.
If you are using DNS servers managed by OVHcloud, please consult this guide.
Configuring your Load Balancer
In this step, create a first Listener which will listen on port 80 (HTTP) and will take care of redirecting HTTP to HTTPS. It will also contain a redirection rule to the Let's Encrypt instance for certificate verification.
We will now create the redirection rules:
Generating a certificate
From the Let's Encrypt instance, you can now launch the certificate generation.
Once the process is completed, your certificate will be located in /etc/letsencrypt/live/domain.tld. You will then need to merge the certificate with its certificate private key:
Now that you have your certificate, you can add a Secure Listener and associate a pool and its members with it :
You have to download this file directly to your local device in order to send it to OpenStack Barbican ("Secret as a Service").
Configuring the secure Listener on the Load Balancer
With your certificate now created, you can add a secure Listener:
You can now securely access your Load Balancer with Let's Encrypt. Be careful, you will need to renew the certificate every 3 months.
Go further
Official documentation of OpenStack Octavia
Getting started with Load Balancer on Public Cloud
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for assisting you on your specific use case of your project.
Join our community of users on https://community.ovh.com/en/.