Deploying a High‑Availability k3OS Cluster with Built‑In etcd: A Practical Guide
Deploy a high‑availability k3OS cluster with embedded etcd in minutes. Learn the step‑by‑step process, inspect auto‑generated configs, test rolling upgrades, and understand the 3‑node limitation and static pod trade‑offs.
09 Jul 2025, 08:17 UTC

Why Use k3OS HA with Embedded etcd?
Running Kubernetes in production often means you need a resilient control plane that can survive node failures. For small to medium deployments, k3OS offers an out‑of‑the‑box solution: when you launch a cluster in HA mode, it automatically spins up a three‑node embedded etcd cluster and deploys the API server as a static pod. This eliminates the need to hand‑craft etcd manifests, TLS certificates, or external etcd provisioning. The trade‑off is a fixed 3‑node limit and the static pod mechanism, but for many edge or edge‑to‑cloud scenarios the convenience outweighs the constraints.
Getting Started: Creating the HA Cluster
Below is a step‑by‑step walkthrough that assumes you have three bare‑metal or virtual machines ready. All commands run on the first node; the others will be joined automatically.
Install k3OS on each node (use the ISO or ISO‑less installer). After boot, SSH into the first machine.
Create the HA cluster with the built‑in etcd:
sudo k3os cluster create --haExplanation:
--hatells k3OS to generate a three‑node etcd cluster.- The command writes the cluster configuration to
/etc/k3os/cluster.yamland deploys the etcd static pod. - k3OS automatically generates TLS certificates for the API server and etcd communication.
On the other two nodes, run
k3os jointo add them to the cluster. The join token is printed after the first node’s command finishes.sudo k3os join https://<first-node-ip>:6443 --token <token>Verify that the cluster is healthy. From any node, run:
kubectl get nodesYou should see three nodes in
Readystate.Check that the embedded etcd service is active:
systemctl status k3os-etcd
Inspecting the Auto‑Generated Configuration
k3OS writes the cluster definition to /etc/k3os/cluster.yaml. Open it to see the etcd endpoints, TLS settings, and static pod manifests. A snippet looks like this:
apiVersion: v1
kind: Config
clusters:
- name: cluster
cluster:
server: https://<first-node-ip>:6443
certificate-authority-data: <base64‑encoded‑ca>
nodes:
- address: <first-node-ip>
role: controlplane
- address: <second-node-ip>
role: controlplane
- address: <third-node-ip>
role: controlplane
etcd:
servers:
- https://<first-node-ip>:2379
- https://<second-node-ip>:2379
- https://<third-node-ip>:2379
caFile: /etc/k3os/ca.crt
certFile: /etc/k3os/etcd.crt
keyFile: /etc/k3os/etcd.key
Notice that the etcd section references the same TLS files used by the API server, ensuring secure communication.
Rolling Upgrades: Keeping the API Server Alive
k3OS performs upgrades by pulling a new image and restarting the static pod. Because the API server is part of a rolling update strategy, at least two nodes stay online during the process. Test it with:
sudo k3os upgrade
While the upgrade runs, run kubectl get nodes on a separate terminal. You should see nodes coming online one after another, and the cluster never loses the Ready status on all three nodes.
Trade‑Offs and Limitations
- 3‑node limit: The built‑in etcd cluster supports only three control plane nodes. For larger clusters, you must either manually configure etcd or point k3OS to an external etcd cluster via the
--etcd-endpointsflag. - Static pod manifests: k3OS stores the etcd and API server manifests in
/etc/k3os/static-pods. If you need to tweak etcd parameters (e.g., data directory, snapshot frequency), you’ll have to edit the manifests and restart the service manually. - Certificate rotation: k3OS auto‑generates certificates on first boot. If you need to replace them (e.g., after a CA change), you must regenerate the cluster configuration and re‑apply the manifests.
When to Use External etcd
If you anticipate scaling beyond three control planes or require a dedicated etcd cluster for compliance, you can still use k3OS with an external etcd endpoint. Create a cluster with --etcd-endpoints pointing to your etcd cluster and provide the CA, cert, and key files. The rest of the bootstrap process remains unchanged.
Actionable Checklist
- Provision three nodes with k3OS installed.
- Run
k3os cluster create --haon the first node. - Join the remaining nodes with
k3os join. - Verify cluster health with
kubectl get nodesandsystemctl status k3os-etcd. - Optional: Test a rolling upgrade with
k3os upgrade. - Document the
/etc/k3os/cluster.yamlfile for future reference. - If scaling, plan an external etcd deployment and re‑create the cluster with the appropriate flags.
By following this guide, you can quickly spin up a resilient k3OS cluster with minimal configuration overhead, while being aware of the 3‑node constraint and static pod management.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.