I am trying to set the flag "advertise-address" in...
# general
g
I am trying to set the flag "advertise-address" in rke2.conf in a cluster that has been created by rancher using the "custom" option with the registration script. I can not find documentation how to set this either in registration or the cluster config in rancher. My goal is to use my kubevip HA IP as join ip so when a master is down rke2-agent can start properly without first having to overwrite the "server" key in the rke2.config. When setting
--internal-address
in the registration script flags it also creates the advertise-address for that ip, but if I set that to the kubevip HA IP, etcd wont start on that node.
-address
has no effect on advertise-address or the join ip assigned to worker nodes. Am I missing something or is this not possible? Would I have to add another managed configfile in /etc/rancher/rke2/config.yaml.d/ to only manage the advertise-address? It seems that this topic is not really mentioned in github issues or documentation, am I putting too much importance on the join ip of workers being a single point of failure?
c
Don't do this. You cannot use an external VIP as the registration address when provisioning via Rancher. Rancher manages this for you by ensuring that a valid node (known as the init node) is used as the endpoint when joining additional nodes. The registration address is only needed when joining the cluster, not when starting after having joined, so this does not affect HA.
You're working too hard to fix something that shouldn't be an issue. Don't try to mess around with the server address or advertised addresses or stick kube-vip in the middle where Rancher doesn't expect it to be
It's a fixed registration address. Registration The addresses of servers are cached once the node joins, so as long as at least one is up they will start up fine. After join it's just a fallback in case none of the servers it was previously aware of are reachable.
g
Okay thank you very much for that detailed answer. I´ll drop this thought then. 🙂 I had some cases in my lab when I was breaking my test cluster in creative ways where I had to manually change the server IP from master1 (down) to master2 on a worker node which showed down in kubernetes and restart rke2-agent did nothing, that was why I was under the impression that having the registration IP HA would improve this.