Setting up a shared virtual IP with Talos Linux

Unveil how to effectively utilize the virtual IP features offered by Talos in this insightful guide.

This is useful because you can set up a shared virtual IP address which is used by every control plane node. It is similar to a HAProxy + Keepalived high availability setup, which is really awesome. When you have a virtual IP, you don’t need to worry about routing when adding new control plane nodes in your cluster, as this one will stay the same. This virtual IP allows for Kubernetes API server access when you set it up as the control plane endpoint.

Tip
You can do this before installing Talos, or if you have already installed it, do it with talosctl edit machineconfig.

This configuration has to be applied on your control plane nodes. Here is the configuration (click to expand):

1
2
3
4
5
6
7
8
machine:
  network:
    vip:
      ip: 192.168.0.250

cluster:
  controlPlane:
    endpoint: https://192.168.0.250:6443 # Endpoint is the canonical controlplane endpoint, which can be an IP address or a DNS hostname.

And you have to set up your worker nodes to use it (click to expand):

1
2
3
cluster:
  controlPlane:
    endpoint: https://192.168.0.250:6443 # Endpoint is the canonical controlplane endpoint, which can be an IP address or a DNS hostname.