Linux

Where Does k0s Store Data and Config?

k0s keeps cluster state in /var/lib/k0s with its join config in /etc/k0s/k0s.yaml on each node.

Last updated

k0s concentrates everything in two spots. The data directory at /var/lib/k0s holds etcd, the kubelet, manifests, and container state for the node. The join file at /etc/k0s/k0s.yaml carries the cluster configuration.

Controllers and workers share the same layout with different roles enabled. Resetting a node means stopping k0s and clearing the data dir, then rejoining with a fresh token. Keep the config file in version control and tokens out of it.

Where k0s stores this, by platform

Linux
/var/lib/k0s

etcd data, kubelet state, and manifests per node. Cluster config lives separately in /etc/k0s/k0s.yaml. Clear with k0s stopped to reset a node.

Frequently asked questions

Where is the k0s config file?

At /etc/k0s/k0s.yaml on each node. Generate a default with k0s config create, then edit roles and networking. Controllers read it on start.

How do I get the kubeconfig from k0s?

Run k0s kubeconfig admin on a controller and save the output to ~/.kube/config. That file grants full cluster access, so store it like a password.

Notice an outdated path? Let us know.