Access your cluster through a domain

Introduction

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.

Load Balancer and DNS

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 :

cluster.yaml yaml
apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: mycluster spec: topology: class: hetzner-apalla-1-30-v3 version: {% $clusterstack.kubernetes.ccurrent %} controlPlane: replicas: 3 workers: machineDeployments: - class: workeramd64hcloud name: md-0 replicas: 1 failureDomain: nbg1 variables: overrides: - name: workerMachineTypeHcloud value: cpx31 variables: - name: region value: nbg1 - name: controlPlaneMachineTypeHcloud value: cpx31 - name: clusterEndpointHost // [!code focus] // [!code tooltip:your.domain.your-company.com:1:Your domain goes here] value: 'your.domain.your-company.com' // [!code focus] // [!code tooltip:lb11:1:Type you selected on Load Balancer creation] - name: clusterLoadBalancerType // [!code focus] value: 'lb11' // [!code focus] // [!code tooltip:tutorial-lb:1:The name you gave to your Load Balancer] - name: clusterLoadBalancerName // [!code focus] value: 'tutorial-lb' // [!code focus]

Optionally, you can set the Load Balancer algorithm with the clusterLoadBalancerAlgorithm variable:

yaml
- name: clusterLoadBalancerAlgorithm value: "least_connections"
Previous
OIDC configuration for your cluster
Next
Using specific Cluster Stack versions