Create a full-featured Kubernetes Cluster on your PC
With only a single command, you could have a fully-functional cluster running locally in seconds!
Kind is a tool for creating a Kubernetes cluster on your localhost. It creates a full cluster with all of the same features you'd find in a full-size cluster, and it's a very cost effective way to learn Kubernetes or try out new concepts, ideas, or tools.
When to Use Kind
I recently weighed the idea of creating namespaces in our non-production cluster for each of our developers so that they would have a place where they could do nearly anything. This would be a great way for them to get additional exposure to Kubernetes with some nice guardrails to keep them safe. The downside is that I would now have to manage several namespaces. Beyond that, those developers are likely going to want to create additional resources outside of the cluster (such as databases) to support test applications they want to deploy. It just becomes a hassle. This is where Kind shines. The developers can have a cluster locally where they have 100% free reign over the entire cluster, and they can also create databases locally to support their efforts. They aren't restricted or waiting for some resource.
Additionally, as mentioned above, Kind is a great way to try new things while keeping cost low. Looking to install a new appliance in your clusters? Install it in your Kind cluster first so that you can fully understand how it works and what it affects. Then, once you know that it won't cause any harm and you've had some practice dealing with any issues, you can install Kind in your shared clusters and be confident that everything will go smoothly. So yeah, Kind clusters are also a phenomenal tool for cluster administrators.
How to Create a Kind Cluster
It's a fairly simple process.
- Install Golang (version 1.11 or higher)
- Install Docker
- Run this command:
GO111MODULE="on" go get sigs.k8s.io/[email protected] && kind create cluster
Note: If you get a message like
command not found: kind, then you will need to add the golang bin folder to your PATH and rerun the
kind create cluster command.
At this point, you should have a fully operational cluster running locally. Kind should have also set your kubectl context to reference your new cluster. Run
kubectl config current-context and you should see a response that says
You're ready to rock. Start deploying and doing anything you need. When you're done, you can run
kind delete cluster to clean everything up.