k3s-cluster-ops
Skill0 starsChanged 50 days agoMITView on GitHub
Install, configure, upgrade, back up, and troubleshoot K3s lightweight Kubernetes clusters, including joining nodes, ingress, storage, and registries. Use when working on a K3s cluster, a home lab or edge Kubernetes setup, or when a K3s node or workload will not start.
In this repository4 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 13
Do NOT use for general Kubernetes questions that are not specific to K3s defaults and tooling.
- Very specific: line 29
Verify with kubectl get nodes -o wide and kubectl get pods -A.
- Very specific: line 36
Node NotReady: check systemctl status k3s-agent, then the journal for certificate, clock, or connectivity errors.
- Very specific: line 38
Image pull failures: check registries.yaml, DNS from the node, and registry credentials.
- Distinctive: line 49
Treat the node token and kubeconfig as secrets.
- Distinctive: line 50
Prefer config files and pinned versions over ad hoc flags so a rebuilt node matches the others.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
K3s Cluster Operations
When to use
- Standing up a new single-node or multi-node K3s cluster.
- Joining or removing nodes, upgrading K3s, or taking and restoring backups.
- A K3s service, node, or workload is unhealthy and needs diagnosing.
- Do NOT use for general Kubernetes questions that are not specific to K3s defaults and tooling.
Key facts
- K3s runs as the
k3ssystemd unit on servers andk3s-agenton agents. Logs:journalctl -u k3s(or-u k3s-agent). - The admin kubeconfig is
/etc/rancher/k3s/k3s.yaml. Copy it elsewhere and change the server address from127.0.0.1to the node's address before using it remotely. - The join token is at
/var/lib/rancher/k3s/server/node-token. Agents join withK3S_URLandK3S_TOKENset at install time. - Defaults bundle Traefik (ingress), ServiceLB (load balancer), CoreDNS, metrics-server, and the local-path storage provisioner. Disable any of them with
--disableflags when you bring your own. - Manifests dropped into
/var/lib/rancher/k3s/server/manifests/are applied automatically. - Private registry mirrors and credentials go in
/etc/rancher/k3s/registries.yaml; restart the service after editing. - Configuration can live in
/etc/rancher/k3s/config.yamlinstead of long command-line flags, which keeps installs reproducible.
Steps
- Pick the datastore. A single server uses embedded SQLite by default. For high availability use embedded etcd by starting the first server with
--cluster-initand joining further servers (an odd number, three or more) with the same token. - Install with the official script, pinning the version with
INSTALL_K3S_VERSIONso nodes do not drift. - Verify with
kubectl get nodes -o wideandkubectl get pods -A. Every system pod should reach Running before deploying workloads. - Upgrade servers one at a time, then agents, by re-running the install script with the new pinned version, or use the system-upgrade-controller for rolling upgrades. Do not skip minor versions.
- Back up before any upgrade. With embedded etcd use
k3s etcd-snapshot save, and copy snapshots off the node; scheduled snapshots are configured throughetcd-snapshot-schedule-cronandetcd-snapshot-retention. With SQLite, copy the datastore files under/var/lib/rancher/k3s/server/db/while the service is stopped. - To remove a node, drain it with
kubectl drain, delete it withkubectl delete node, then runk3s-uninstall.sh(server) ork3s-agent-uninstall.sh(agent) on the machine.
Troubleshooting
- Node NotReady: check
systemctl status k3s-agent, then the journal for certificate, clock, or connectivity errors. Confirm the agent can reach port 6443 on the server. - Pods stuck Pending:
kubectl describe podand read events; the usual causes are insufficient resources, taints, or an unbound PVC. - Image pull failures: check
registries.yaml, DNS from the node, and registry credentials. - Ingress not responding: confirm Traefik pods are running and the Ingress class matches, and check that nothing else already binds ports 80 and 443 on the node.
- Time skew: clock drift breaks certificate validation; make sure NTP is running on every node.
- Firewall rules must allow 6443 (API), 8472/udp (flannel VXLAN), and 10250 (kubelet) between nodes.
Output
The commands or config to apply, the expected result of each, and any rollback step. Flag every step that restarts the cluster or loses data.
Notes
- Treat the node token and kubeconfig as secrets; never commit them.
- Prefer config files and pinned versions over ad hoc flags so a rebuilt node matches the others.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

