kind vs k3s: Run Kubernetes Locally for Learning and Testing

kind vs k3s: Run Kubernetes Locally for Learning and Testing

Every Kubernetes tutorial eventually says the same thing: try it yourself on a cluster. And every learner then discovers the same problem. A real cluster costs money, takes time to provision, and is a bad place to make mistakes, because a mistake in a shared cluster affects other people. What you need is a cluster on your own machine, one you can create in a minute, break without consequence, and delete when you are done. Two tools dominate that job, and they take opposite approaches to it. kind runs Kubernetes nodes as Docker containers. k3s runs Kubernetes as a single lightweight binary on a Linux host. Both give you a real, conformant Kubernetes cluster.

This guide compares them properly. You will learn what each tool is and how it works, how to install and run both, how to build a multi-node cluster with each, and which one to pick for the four jobs people actually use local clusters for: learning Kubernetes, testing applications and operators, running continuous integration, and keeping a small cluster alive for months. If you have not yet worked through the fundamentals, our Kubernetes tutorial for beginners explains the concepts these tools put on your laptop, and it is worth reading first.

What kind Is: Kubernetes in Docker

kind stands for Kubernetes IN Docker, and the name is the whole design. kind runs each Kubernetes node as a Docker container. A single-node cluster is one container running the control plane. A three-node cluster is three containers: one control plane and two workers. Inside each container, the Kubernetes components run the way they run on a real cluster, bootstrapped by kubeadm, with etcd as the datastore and containerd as the container runtime. The nodes are containers, but the Kubernetes inside them is the standard upstream Kubernetes, not a cut-down version of it.

kind was built by the Kubernetes Special Interest Group for testing, and its original job was testing Kubernetes itself. The Kubernetes project’s own continuous integration uses kind to run conformance tests, which tells you something important about its fidelity: if your manifests behave a certain way on a kind cluster, they will behave the same way on a production cluster, because the code running underneath is the same code. That fidelity is kind’s main selling point. It is the closest thing to a production cluster you can run on a laptop, and it is the tool that most platform teams reach for when they need to test something that depends on real cluster behaviour, such as an operator, a controller, or a network policy.

The cost of that fidelity is weight. A kind cluster runs a full etcd, a full API server, a scheduler, a controller manager, and a kubelet for every node, all inside containers that also run systemd. It needs Docker, and it needs enough memory to run the whole stack. On a machine with 16 GB of RAM that is irrelevant. On a machine with 8 GB that is also running a browser, an editor, and a local database, you will feel it. kind clusters are also disposable by design. They are not meant to stay up for months. You create one, use it, delete it, and create another.

There is one more thing to know about kind before you install it. Because the nodes are containers, they do not share your host’s container image store. An image you build on your laptop with docker build is invisible to the kind cluster until you load it in with kind load docker-image my-app:latest. kind also ships with almost nothing pre-installed: no ingress controller, no load balancer, no storage provisioner beyond a basic local path provisioner in some configurations. You install the pieces you need, which is exactly what you want in a test cluster, because it means the cluster matches what you built, not what the tool assumed.

What k3s Is: A Lightweight Kubernetes Distribution

k3s is a different kind of thing. It is a full Kubernetes distribution, packaged as a single binary, built for environments where a standard Kubernetes installation is too heavy: edge devices, small servers, Raspberry Pi clusters, home labs, and Internet of Things deployments. It is a CNCF-hosted project, maintained by SUSE Rancher, and it is a certified conformant Kubernetes distribution, which means it passes the same conformance tests as upstream Kubernetes. It is not a cut-down Kubernetes in the sense of missing features. It is Kubernetes with the parts you do not need in a small deployment removed or replaced, and the parts you do need bundled in.

The changes k3s makes are specific and documented. The datastore is SQLite by default for a single-server cluster, instead of etcd, which removes a heavy dependency and makes the whole thing start in seconds. Embedded etcd or an external database are options for clusters with more than one server. The binary bundles containerd, so you do not install a container runtime separately. It ships with Flannel for networking, CoreDNS for service discovery, Traefik as the ingress controller, a local path storage provisioner, and a simple service load balancer called ServiceLB. On a standard Kubernetes cluster you install all of those yourself. On k3s they are there from the first minute.

The other defining difference is persistence. A k3s cluster is meant to stay up. It installs as a system service, configured to restart automatically after a reboot or a crash, and the kubeconfig is written to a fixed location on the host. That makes k3s the right tool for a cluster you keep: a home lab server, a small edge deployment, a development server shared by a team. It also makes k3s a poor fit for the throwaway workflow kind is built for.

There is one constraint that matters more than any other. k3s only runs on Linux. On a Mac or Windows machine you need a virtual machine, or k3d, which is a wrapper that runs k3s nodes in Docker containers, in the same way kind runs its nodes in Docker. k3d is a separate project from k3s, and it is the right tool if you want k3s behaviour on a non-Linux laptop. This guide covers k3s itself, on Linux, because that is where it is meant to run, and because the comparison with kind is clearest when each tool runs in its natural habitat.

Installing kind Step by Step

Installing kind takes two prerequisites and one binary. You need Docker running on your machine, because kind’s nodes are Docker containers, and you need kubectl, because that is how you talk to the cluster once it exists. If you do not have Docker yet, install Docker Desktop for Mac or Windows, or Docker Engine for Linux, and confirm it works with docker ps before you go further. Our Docker tutorial for beginners covers installing Docker and the basics of containers if either of those is new to you.

With the prerequisites in place, download the kind binary for your platform and put it somewhere on your PATH. The kind quick start page lists the current release, and you should use the version it shows rather than copying a version number from an older article, because kind releases regularly and the version in a tutorial goes stale quickly. On Linux, the download is a single curl command that fetches the binary, makes it executable, and moves it into /usr/local/bin. On macOS, the easiest route is Homebrew with brew install kind. On Windows, Chocolatey with choco install kind does the same job. Whichever route you take, verify the install with kind version before you create a cluster.

# Install kind on Linux (check the quick start page for the current version)
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.33.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind

# Install kind on macOS with Homebrew
brew install kind

# Verify the install
kind version

# Create a cluster with default settings
kind create cluster

# Check the cluster is up and kubectl is talking to it
kubectl cluster-info --context kind-kind
kubectl get nodes

The default cluster is a single control-plane node, and it is enough for most learning and testing. kind writes the kubeconfig for you and switches your kubectl context to the new cluster automatically, so kubectl get nodes works immediately. The context is named kind-kind, which is the cluster name prefixed with kind-, and that naming matters when you run more than one cluster, because each cluster gets its own context and you switch between them with kubectl config use-context.

Loading a local image is the one workflow step that kind requires and other tools do not. Build your image on the host, then run kind load docker-image my-app:latest, and the image is copied into the cluster’s nodes. Without that step, a pod that references your image will fail with ImagePullBackOff, because the cluster tries to pull the image from a registry and it is not there. If you use a local registry instead, kind can be configured to use it, but for most learning and testing, the load command is the simpler path, and it is fast enough to run on every rebuild.

# Build an image on the host, then load it into the kind cluster
docker build -t my-app:latest .
kind load docker-image my-app:latest

# List the clusters kind is managing
kind get clusters

# Delete the cluster when you are done
kind delete cluster

# Create a named cluster, so you can run several at once
kind create cluster --name dev
kind delete cluster --name dev

Installing k3s Step by Step

Installing k3s on Linux is one command. The k3s quick-start guide provides an install script at get.k3s.io, and running it downloads the binary, installs it as a systemd or OpenRC service, and starts the cluster. The command is curl -sfL https://get.k3s.io | sh -, and you should run it with sudo or as root, because it writes system files and registers a service. After the script finishes, the cluster is running, the service is configured to restart automatically, and the kubeconfig is written to /etc/rancher/k3s/k3s.yaml. The install script also installs a copy of kubectl and a few utilities, including crictl for inspecting the container runtime and k3s-uninstall.sh for removing the cluster cleanly.

The kubeconfig location is the first thing to sort out after the install, because the file is owned by root and your regular user cannot read it. The standard approach is to copy it to your home directory and fix the permissions: sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config followed by sudo chown $USER ~/.kube/config. Once kubectl can read the config, kubectl get nodes should show a single node in Ready state, and you have a working cluster with Traefik, CoreDNS, and the local path provisioner already running.

# Install k3s as a service on a Linux host
curl -sfL https://get.k3s.io | sh -

# Make the kubeconfig readable by your user
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chown $USER ~/.kube/config

# Check the cluster and its bundled components
kubectl get nodes
kubectl get pods -A

# Deploy a test workload and expose it
kubectl create deployment nginx --image=nginx
kubectl expose deployment nginx --port=80 --type=LoadBalancer
kubectl get svc nginx

Adding a second node to a k3s cluster uses the same install script with two environment variables. Run the script on the new machine with K3S_URL set to the server address and K3S_TOKEN set to the token stored on the server at /var/lib/rancher/k3s/server/node-token. Setting K3S_URL makes the installer configure the node as an agent instead of a server, and the agent registers itself with the server automatically. Each machine needs a unique hostname, or you must pass K3S_NODE_NAME with a unique value, because k3s identifies nodes by hostname and two nodes with the same name will conflict.

For a cluster with more than one server, the datastore question matters. A single server uses embedded SQLite, which cannot be shared, so a multi-server cluster needs either embedded etcd, started on the first server with the --cluster-init flag, or an external database such as MySQL, PostgreSQL, or etcd. Start with one server and add agents first. Add a second server only when you need control plane redundancy, and when you do, use an odd number of servers, three or more, because etcd needs a quorum to make decisions.

kind vs k3s Head to Head

The comparison that matters is not a list of features. It is a list of trade-offs, and the right way to read it is to find the row that describes your situation and follow it to a decision. The table below covers the dimensions that actually change the choice: what each tool is for, how its nodes run, how fast it starts, what it ships with, how much it costs in resources, and where it runs.

Purpose first. kind is a test and continuous integration tool. It exists to create clusters quickly, run something against them, and delete them. k3s is a lightweight production distribution. It exists to run a cluster that stays up, on hardware where a standard Kubernetes installation is too heavy. That difference in purpose explains almost everything else. kind is disposable. k3s is persistent. kind is for the cluster you throw away. k3s is for the cluster you keep.

Nodes run differently. kind runs each node as a Docker container, with kubeadm wiring the components together exactly as a real cluster is bootstrapped. k3s runs the whole control plane as a single process on a Linux host, with containerd bundled in and SQLite as the default datastore. A kind cluster comes up in well under a minute; a k3s cluster in seconds, because there is less to start. Resource use follows too: k3s uses less memory and disk than kind, because it runs one binary instead of a container per node with a full component stack inside each.

What ships with each tool is the next difference, and it cuts in k3s’s favour for anyone who wants a working cluster immediately. kind ships with almost nothing: no ingress controller, no load balancer, no storage provisioner beyond the basics. You install what you need. k3s ships with Traefik, CoreDNS, a local path provisioner, and ServiceLB, so a workload exposed as a LoadBalancer service works the moment the cluster is up. That completeness is a genuine advantage for a home lab or an edge deployment, and a minor inconvenience for a test cluster, where you usually want to choose your own components anyway.

Multi-node support exists in both, but it works differently. kind builds multi-node clusters from a config file, with control-plane and worker roles declared in YAML, and the whole cluster is created by one command. k3s builds multi-node clusters by joining agents to a server, one machine at a time, which is the natural shape for real hardware and the awkward shape for a laptop. kind runs anywhere Docker runs, including macOS and Windows through Docker Desktop, while k3s runs on Linux only, and needs a virtual machine or k3d on other platforms.

Multi-Node Clusters and Real Workloads

A single-node cluster is enough for learning, but most of the interesting Kubernetes behaviour only shows up with more than one node: scheduling decisions, pod anti-affinity, node failure, rolling updates that move pods between nodes. Both tools support multi-node clusters, and both make it easy enough to try, so this is worth doing even if you only ever run one node in the end, because it teaches you how the scheduler thinks.

For kind, multi-node means a config file. The file declares the cluster and lists the nodes with their roles: one control-plane node and two workers is the standard shape. The config file format is kind.x-k8s.io/v1alpha4, and you pass it with kind create cluster --config=cluster.yaml. Once the cluster is up, kubectl get nodes shows three nodes, and you can test scheduling directly: create a deployment with three replicas and watch the pods spread across the workers, or drain one worker with kubectl drain and watch the pods move to the other one. The whole exercise takes a few minutes, and deleting the cluster afterwards takes seconds, which is the point of kind: the multi-node cluster is as disposable as the single-node one.

# kind: a three-node cluster from a config file
cat <<EOF > cluster.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
  - role: worker
  - role: worker
EOF

kind create cluster --config=cluster.yaml
kubectl get nodes

# Watch three replicas spread across the two workers
kubectl create deployment web --image=nginx --replicas=3
kubectl get pods -o wide

For k3s, multi-node means real machines, or at least real virtual machines, and the shape is different. You install a server on one machine, then run the install script on each additional machine with K3S_URL and K3S_TOKEN, and each one joins as an agent. The cluster grows one machine at a time, and it stays grown: the agents are persistent members of the cluster, not throwaway containers.

Real workloads behave the same on both, because both run conformant Kubernetes, but the experience of running them differs in small ways that add up. On kind, you load images into the cluster, you install your own ingress controller, and you accept that a LoadBalancer service will stay pending unless you install something like MetalLB to provide one. On k3s, the image is already on the host if you built it there, Traefik is already running, and a LoadBalancer service gets an address from ServiceLB immediately.

Debugging a local cluster uses the same commands as debugging any cluster, and the same failure modes appear. A pod stuck in Pending is usually a scheduling problem or an unbound volume claim. A pod in ImagePullBackOff on kind usually means you forgot to load the image. A pod in CrashLoopBackOff means the application is failing, and the fix is in the logs, not in the cluster. Our Kubernetes CrashLoopBackOff fix guide walks through that failure step by step, and it applies exactly the same way on a local cluster as it does on a production one, because the failure is in the pod, not in the tool that created the cluster.

Which One Should You Choose?

The decision is simpler than the comparison makes it look, because it reduces to one question: is this cluster a tool or a place? If it is a tool, something you create to test a thing and then delete, choose kind. If it is a place, somewhere your workloads live for weeks or months, choose k3s. Most people who work with Kubernetes need both at different times, and there is nothing wrong with installing both and using each for the job it fits.

Choose kind when you are learning Kubernetes and want the most faithful reproduction of a production cluster, when you are testing an operator, a controller, or a Helm chart and need to see how it behaves on real Kubernetes, when you are writing continuous integration pipelines that need a fresh cluster for every run, or when you need multi-node behaviour on a laptop and you need it in under a minute. kind is also the right choice when you follow documentation written for standard Kubernetes, because most upstream guides, including the Cilium installation guide and the Gateway API quickstarts, are written and tested against kind.

Choose k3s when the cluster needs to stay up: a home lab, a small server, an edge device, a Raspberry Pi cluster, or a development server shared by a team. Choose k3s when the machine is small and resources matter, because k3s uses less memory and disk than a full cluster, and it starts faster after a reboot because it is a system service. Choose k3s when you want a complete cluster out of the box, with an ingress controller and a load balancer already running, rather than installing each piece yourself. And choose k3s when you are building something for a non-cloud environment, where the cluster has to work without a cloud provider’s load balancers and storage, because k3s was designed for exactly that situation.

There is a third option worth naming, because it confuses the comparison. minikube is the oldest local Kubernetes tool, and it is still a good choice for a single-node development cluster with add-ons and a dashboard, especially when you want a virtual machine rather than containers. It is heavier than both kind and k3s, and slower to start, but it has the largest community and the most add-ons. If you want k3s behaviour inside Docker containers on a Mac or Windows machine, k3d is the wrapper that does it, giving you the speed of kind with the lightness of k3s.

The practical advice is to install kind first if you are learning, because it is the fastest route to a working cluster and the easiest to throw away, and to install k3s first if you have a Linux machine that will host a cluster for months. Try the other one when the first stops fitting. The skills transfer completely, because both run the same Kubernetes API, the same kubectl, and the same manifests. The tool changes. The knowledge does not.

Frequently Asked Questions

What is the difference between kind and k3s?

kind runs Kubernetes nodes as Docker containers and is designed for disposable test clusters, especially in continuous integration. k3s is a lightweight Kubernetes distribution packaged as a single Linux binary, designed for clusters that stay up, such as home labs and edge devices. kind is a test tool. k3s is a distribution you keep.

Can I run kind and k3s on macOS or Windows?

kind runs anywhere Docker runs, including macOS and Windows through Docker Desktop. k3s runs on Linux only, so on a Mac or Windows machine you need a virtual machine, or k3d, which is a wrapper that runs k3s nodes in Docker containers. If your laptop is not Linux, kind is the simpler choice.

How do I load a local Docker image into a kind cluster?

Run kind load docker-image my-app:latest after building the image on your host. kind nodes are containers with their own image store, so an image built on your laptop is invisible to the cluster until you load it in. Without that step, pods referencing your image will fail with ImagePullBackOff.

Does k3s need etcd?

No, not by default. A single-server k3s cluster uses embedded SQLite as its datastore. For a multi-server cluster you need embedded etcd, started with the --cluster-init flag, or an external database such as MySQL, PostgreSQL, or etcd. SQLite cannot be shared between servers, so it is only an option for one server.

Which is better for learning Kubernetes, kind or k3s?

kind, for most learners. It runs the standard upstream Kubernetes, it matches the documentation and quickstarts written for production clusters, and its clusters are disposable, so you can break things freely and start again in a minute. k3s is the better choice once you want a cluster that stays up, such as a home lab you keep running for months.

Conclusion

kind and k3s solve the same problem from opposite directions. kind gives you a faithful copy of a production cluster, packaged as containers, built to be created and deleted in minutes. k3s gives you a lightweight distribution that runs as a single binary, built to stay up on small hardware for months. Neither is better in general. Each is better for the job it was designed for, and the fastest way to learn the difference is to install both, create a cluster with each, deploy the same application to both, and watch how they behave.

Start with kind if you are learning or testing, and start with k3s if you have a Linux machine that needs a cluster that lasts. Either way, the cluster on your laptop is where Kubernetes stops being something you read about and starts being something you operate, and that is the step that matters. Break it, fix it, delete it, and build it again.

Scroll to Top