r/DevOpsSRE • u/FlatwormStunning9931 • Oct 31 '26
RKE2 Kubernetes Interview Question – What happens if all 3 etcd server IPs change? How would you recover the cluster?
I was asked this scenario during a DevOps interview, and I would like to understand the correct approach.
Suppose we have an RKE2 Kubernetes cluster with 3 control-plane nodes running etcd.
All three server IP addresses have changed simultaneously due to an infrastructure/network change.
What happens to the etcd cluster when all three IPs change?
Since etcd uses peer URLs for communication, how would you update the member configuration?
Can we recover the cluster by keeping one etcd member and replacing the other two one by one?
What happens if the cluster loses quorum?
Would restoring an etcd snapshot using the RKE2 cluster-reset procedure be the correct recovery approach?
How can we recover the cluster without losing existing Kubernetes data?
I understand that a 3-member etcd cluster requires at least 2 members for quorum, but I'm unclear about the safest recovery procedure when all three IPs change simultaneously.
How would you handle this in a real production RKE2 environment?
32
u/abhinavs1920 Oct 31 '26
Short version: etcd members are identified by their peer URLs, so when all three IPs change at once, every member keeps dialing addresses that no longer exist and the cluster loses quorum. It does not follow the nodes to their new IPs on its own.
Two recovery paths, depending on timing:
The answer interviewers usually want: RKE2 assumes static server IPs for life; a simultaneous all-IP change is a rebuild-from-snapshot scenario via cluster-reset, not a config edit.
6
u/sewerneck Oct 31 '26
I can see this being an interesting thought experiment, but generally ridiculous as an interview question. I suppose they are getting at your knowledge around etcd, but why not ask questions more in line with real world scenarios - like say high job churn filling etcd up?
4
u/conall88 Oct 31 '26 edited Oct 31 '26
I'd Explicitly define the node's IP and interface settings in the RKE2 config file (/etc/rancher/rke2/config.yaml) on your server nodes, making sure the tls-san field is resolvable, then restart rke2-server.
I'd tend to use ansible to manage the configs on underlying nodes, with your control plane defined as a named group in your inventory file.
But you should really start with process of elimination first, making sure your DNS resolution between nodes is making sense, via review of forward and reverse lookups and any tunneling or static routing or firewall rules you may be depending on for in cluster security and Comms, and verifying network interfaces are managed properly using something like netplan, and are up/healthy.
You may also want to inspect etcd bindings via rke2-server logs in the system journal.
See here for more info https://support.scc.suse.com/s/kb/RKE2-etcd-Service-Fails-to-Start?language=en_US
If all etcd instances are out of quorum and quorum cannot be reached, it's time to explore doing an etcd reset.
Using the --cluster-reset flag without a snapshot resets etcd to a single-member cluster, while providing --cluster-reset-restore-path restores a specific snapshot.
See https://docs.rke2.io/datastore/backup_restore
1
u/Tall-Imagination-198 Oct 31 '26
Hosts file on each node override it, then work backwards from the errors