What K3s Does
- Single Binary: Everything (API server, scheduler, kubelet, etc.) in one <100MB binary
- Low Resource: Runs Kubernetes in <512MB RAM (minimum)
- Easy Install: One curl command to install a complete cluster
- SQLite or etcd: Lightweight SQLite backend by default, embedded etcd for HA
- Built-in: Traefik ingress, Flannel CNI, CoreDNS, local-path storage, metrics-server
- ARM Support: Runs on Raspberry Pi and other ARM devices
- Air-Gap Ready: Install without internet connection
- High Availability: HA cluster with embedded etcd (3+ server nodes)
- Upgrade: Simple version upgrades with automatic migration
Architecture
┌─────────────────────────────────────┐
│ K3s Single Binary │
│ ┌──────────┐ ┌──────────────┐ │
│ │API Server│ │ Scheduler │ │
│ └──────────┘ └──────────────┘ │
│ ┌──────────┐ ┌──────────────┐ │
│ │Controller│ │ Kubelet │ │
│ │ Manager │ │ │ │
│ └──────────┘ └──────────────┘ │
│ ┌──────────┐ ┌──────────────┐ │
│ │ Kine │ │ Containerd │ │
│ │ (SQLite) │ │ │ │
│ └──────────┘ └──────────────┘ │
└─────────────────────────────────────┘K3s replaces etcd with Kine (an abstraction layer), which can use SQLite, PostgreSQL, MySQL, or embedded etcd.
Installation
Single Node (Dev/Test)
# Install server (master)
curl -sfL https://get.k3s.io | sh -
# Kubeconfig is at /etc/rancher/k3s/k3s.yaml
sudo chmod 644 /etc/rancher/k3s/k3s.yaml
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
kubectl get nodesMulti-Node Cluster
# On the server (master) node
curl -sfL https://get.k3s.io | sh -
sudo cat /var/lib/rancher/k3s/server/node-token
# Save this token!
# On worker nodes
curl -sfL https://get.k3s.io | K3S_URL=https://server-ip:6443 K3S_TOKEN=your-token sh -High Availability (3 servers with embedded etcd)
# First server
curl -sfL https://get.k3s.io | sh -s - server
--cluster-init
--token=shared-secret
# Additional servers
curl -sfL https://get.k3s.io | sh -s - server
--server https://first-server:6443
--token=shared-secretUninstall
# On server
/usr/local/bin/k3s-uninstall.sh
# On agent
/usr/local/bin/k3s-agent-uninstall.shKey Features
Built-in Components
K3s includes batteries-included components you'd otherwise need to install separately:
├── Traefik (v2) — Ingress controller
├── Flannel — CNI networking
├── CoreDNS — DNS service
├── Metrics Server — kubectl top support
├── Local Path Provisioner — Default storage
├── Helm Controller — HelmChart CRD support
└── Klipper LoadBalancer — ServiceType=LoadBalancerDisable any component if you want to use alternatives:
curl -sfL https://get.k3s.io | sh -s -
--disable traefik
--disable servicelbUsing with Rancher
# Deploy Rancher management UI on K3s
kubectl create namespace cattle-system
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml
helm repo add rancher-stable https://releases.rancher.com/server-charts/stable
helm install rancher rancher-stable/rancher
--namespace cattle-system
--set hostname=rancher.yourdomain.comDeploy Helm Charts
# K3s natively supports HelmChart CRD
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: grafana
namespace: kube-system
spec:
chart: grafana
repo: https://grafana.github.io/helm-charts
targetNamespace: monitoring
valuesContent: |-
service:
type: LoadBalancer
adminPassword: your-passwordAir-Gap Installation
# Download K3s binary and images
wget https://github.com/k3s-io/k3s/releases/download/v1.28.0%2Bk3s1/k3s
wget https://github.com/k3s-io/k3s/releases/download/v1.28.0%2Bk3s1/k3s-airgap-images-amd64.tar.gz
# On target machine
sudo mkdir -p /var/lib/rancher/k3s/agent/images/
sudo cp k3s-airgap-images-amd64.tar.gz /var/lib/rancher/k3s/agent/images/
sudo cp k3s /usr/local/bin/
sudo chmod +x /usr/local/bin/k3sUse Cases
| Scenario | Why K3s? |
|---|---|
| Edge computing | Low resource, ARM support |
| IoT devices | Raspberry Pi compatible |
| CI/CD pipelines | Fast startup, single binary |
| Developer workstation | Full K8s, low overhead |
| Home lab | Easy install, full featured |
| Branch offices | Air-gap ready |
| GitOps (Flux/ArgoCD) | HelmChart CRD support |
K3s vs Alternatives
| Feature | K3s | K8s (kubeadm) | K0s | MicroK8s |
|---|---|---|---|---|
| Binary size | ~100MB | ~1GB+ | ~180MB | ~200MB |
| RAM (idle) | 512MB | 2GB+ | 500MB | 600MB |
| Install time | 30s | 30+ min | 30s | 60s |
| Backend | SQLite/etcd | etcd | etcd | dqlite |
| Certification | CNCF certified | Native | CNCF certified | CNCF certified |
| Best for | Edge, dev, prod | Prod at scale | Prod, edge | Ubuntu users |
FAQ
Q: Is K3s functionally equivalent to full Kubernetes? A: Yes. K3s is a CNCF-certified Kubernetes distribution that passes all conformance tests. The difference is only in packaging — K3s is smaller and easier to deploy, but it runs the same Kubernetes underneath.
Q: Is it suitable for production? A: Very much so. Many companies run K3s at scale in production. SUSE (Rancher's parent company) offers commercial support. In HA mode (3+ server nodes) it provides production-grade availability.
Q: K3s or Docker Swarm — which should I choose? A: If you want the simplicity of Docker Swarm, pick Docker Swarm. If you want the Kubernetes ecosystem (Helm, Operators, complex workloads) but don't want the complexity of full K8s, pick K3s. K3s is the better long-term choice.
Sources & Credits
- GitHub: k3s-io/k3s — 32.7K+ ⭐ | Apache-2.0
- Official site: k3s.io