I've been working with Kubernetes for some time now, and while my preferred platform of choice is talos one of the challenges I've always faced is how to test, develop and iterate quickly without spinning up a full cluster or dealing with expensive cloud resources.That is where kind (Kubernetes in Docker) comes in handy
What problem does this solve?
Kind allows you to quickly and easily spin up Kubernetes clusters from within docker itself. For me I use this when I need to test things like GitOps configurations that have multiple cluster requirements (Think ApplicationSets in ArgoCD).
You can have multiple clusters running as docker containers on the same machine, eliminating the TTD (time to deploy) quite dramatically.
As a result of this, finding bugs and gaps in your GitOps process becomes far simpler. No one wants to be triaging misconfigurations during a disaster recovery scenario.
How does it work?
kind uses Docker to create containers that act as Kubernetes nodes. Each container runs a small Kubernetes distribution, and kind handles the networking and configuration to make them work together as a cluster.
The magic happens through Docker-in-Docker—kind containers which run the Kubernetes components (kubelet, kube-apiserver, etc.) directly, giving you a real Kubernetes experience without the overhead of virtual machines or cloud resources.
Installation
Getting started with kind is straightforward. You’ll need Docker installed and running on your machine.
Once that’s done, you’ll need to install the kind binaries
You can check the latest version and installation instructions at kind’s documentation
Creating your first cluster
Once kind is installed, creating a cluster is as simple as:
| |
This creates a single-node cluster named “my-cluster”. kind will automatically configure kubectl to use this cluster, so you can immediately start using kubectl commands.
To verify everything is working:
| |
Multi-node clusters
One of kind’s powerful features is the ability to create multi-node clusters using a simple configuration file. This is great for testing features that require multiple nodes, like pod scheduling or node affinity.
Create a file called kind-config.yaml:
| |
Then create the cluster with:
| |
This gives you a cluster with three control plane nodes and three worker nodes—perfect for testing more complex scenarios.
Loading container images
One common challenge with Kubernetes is that you need to pull images from container registries during testing. This makes working offline or testing local images slow and laborious.
kind solves this with the kind load docker-image command.
| |
| |
Now your pods can use my-app:latest without needing to pull from a registry.
Example: Deploying a simple application
Here’s a quick example of deploying an application to kind:
| |
Cleaning up
When you’re done testing, cleaning up is just as easy:
| |
Common use cases
kind is particularly useful for:
- Local development: Test your manifests and applications before deploying to production
- CI/CD pipelines: Run integration tests in a real Kubernetes environment without cloud costs
- Operator testing: Develop and test Kubernetes operators locally
- Learning Kubernetes: Experiment with Kubernetes features without the complexity of cloud setup
- Cluster configuration testing: Validate cluster configurations, network policies, and RBAC rules
That’s all for this post. Hope you found it useful. If there’s any information you want clarified, thoughts, opinions, please do let me know