Configure RKE2 to use FQDN instead of IP Addresses

When I joined a master node in an HA cluster I use FQDN, such as:

# /var/lib/rancher/rke2/server/node-token
server: https://my-kubernetes-domain.com:9345
token: my-shared-secret

This works and all master nodes join the cluster. Great! However ETCD still uses IP addresses of masters nodes which causes all heck to break loose if the master nodes change their IP address. This can easily be seen by watching the logs of the etcd pod on the master nodes and see log entries using IP addresses. When this happens, restarting the RKE2 service on the affected nodes has no affect. You have to do a cluster reset on node 1, then delete and rejoin all other master nodes. Worker nodes are unaffected as it appears they properly use FQDN and the rke2-agent service has no direct dependency on ETCD.

“Masters nodes should have static IPs” is a lazy answer to this problem as ETCD fully supports ETCD cluster communication via FQDN. Is there a way to configure RKE2 so that ETCD uses FQDN without having to do manual edits to the ETCD manifest file?

For anyone that reads this in the future, as of today this is not supported within RKE2. If you absolutely need ETCD communication via FQDN instead of IP addresses you will have to manage your own ETCD cluster.

1 Like