Using a domain name is a straightforward way to assign meaningful names to your clusters, making them easier to identify and access.
This guide will help you set up and access your cluster through a domain.
If you don't already have a domain name, you will need to purchase one.
Access the Hetzner console and create a Load Balancer in your project, removing the default service and giving it a meaningful name. Copy the IPv4 that was assigned to it.
The three available Load Balancer types are lb11
, lb21
and lb31
:
Type | Max concurrent connections | Services | Targets | Certificates |
---|---|---|---|---|
lb11 | 10000 | 5 | 25 | 10 |
lb21 | 20000 | 15 | 75 | 25 |
lb31 | 40000 | 30 | 150 | 50 |
Possible values are least_connections
and round_robin
. If this variable is omitted, the default is round_robin
.
Next, access your domain name registrar's dashboard and create an A record pointing to the Load Balancer IPv4. There is no need to create an AAAA record pointing to the LB's IPv6 since we are only using IPv4 in the cluster.
The DNS propagation can take up to 24 hours. If you want to check, you can use dig:
The last step is to add the domain and Load Balancer name and type to the Cluster
resource. Add the following items in spec.topology.variables
:
Optionally, you can set the Load Balancer algorithm with the clusterLoadBalancerAlgorithm
variable: