Skip to content
Notifications
Clear all

What's the best way to test disaster recovery for a K3s cluster?

1 Posts
1 Users
0 Reactions
3 Views
(@lindae)
Estimable Member
Joined: 1 week ago
Posts: 54
Topic starter   [#7900]

Everyone seems to be in a rush to deploy K3s at the edge, in retail, on a submarine, you name it. The sales pitch is always about its lightweight nature and simplicity. What I rarely see discussed with the appropriate level of cynical depth is how you actually validate that your "simple" cluster can survive the myriad of failures waiting to happen. Backing up etcd with `k3s etcd-snapshot` is the obvious first paragraph in any vendor's documentation, but treating that as a "disaster recovery" plan is a recipe for a very long, very bad day.

So, let's move beyond the happy path. I'm looking for methodologies that stress the *recovery* process, not just the backup creation. The assumption that you can just spin up a new VM, restore the snapshot, and have a working cluster is where most teams get brutally surprised. I'm skeptical of any test that doesn't involve deliberate, malicious destruction of the original environment.

Here is what I consider the bare minimum for a meaningful test, and I'm curious where others have found the hidden traps:

* **Total Node Loss:** This is the baseline. Wipe the VMs or kill the instances for all your master nodes simultaneously. Don't just stop the K3s service; destroy the underlying infrastructure. Your recovery procedure must now handle provisioning new OS instances, installing K3s, and then—critically—restoring the snapshot onto a *cold* cluster. The install flags and the order of operations here are a common source of failure.
* **Partial Data Corruption:** Simulate a scenario where your most recent snapshot is corrupted or incomplete. Do you have a procedure to roll back to the previous known-good snapshot? Is your retention policy (managed in `/var/lib/rancher/k3s/server/db/snapshots`) actually aligned with your RPO (Recovery Point Objective)?
* **Network Identity Change:** A true disaster often means spinning up recovery in a new subnet, a new VPC, or even a new region. Your restored cluster will have new IPs. Have you validated that all your core workloads and operators handle this? This is where CNI plugins, persistent volume claims referencing old node names, and load balancer configurations go to die.
* **Application Layer Validation:** Finally, and most importantly, a backup is useless if the applications don't come back online. Your test isn't complete until you've verified that a sample set of stateful and stateless workloads are actually serving traffic correctly post-recovery. This means testing service endpoints, ingress controllers, and data integrity within the pods.

The marketing material makes it sound like a one-command operation. In practice, each of these points requires specific, documented steps and runbooks. What specific pitfalls have you encountered when testing K3s recovery? I'm particularly interested in the intersection of the embedded etcd with persistent storage and how you validated that the restored cluster's networking didn't create a split-brain scenario with other surviving services.


Trust but verify.


   
Quote