A Hassle-Free Guide to set up Disposable Kubernetes Clusters on the fly in under 5 minutes using kind.
A minimalist guide to set up a Kubernetes Cluster using kind.
What is kind?
kind stands for Kubernetes inside of docker which CLI tool that allows spawning Kubernetes cluster on the fly quickly with no hassle. kind bootstraps all the background activities which involve creating a cluster allows us to create local development & testing Kubernetes cluster.
Installation of kind
As a pre-requisite kind requires docker to be installed on your machine.
Go ahead and install docker on your machine.
Kind can be installed on major operating systems.
Installation Guide for the following operating systems
https://kind.sigs.k8s.io/docs/user/quick-start/#installation
- Mac (
brew install kind
) - Windows (
choco install kind
) - Linux
Provisioning clusters using Kind
Let's provision different types of clusters using kind.
1. Provisioning a Simple (Single Node) Cluster
By just specifying the name of the cluster the kind provisions a single node cluster with the latest stable version of Kubernetes & bootstraps all the required components.
kind create cluster --name=my-simple-cluster
Cluster bootstraps all the required components and creates a cluster
In the background Kind provisions a Docker container for the nodes that we provisioned.
2. Provisioning a Multi-Node cluster
Kind allows to spawn a multi-node cluster and specify all the details in the config.
curl https://gist.githubusercontent.com/chrisedrego/4341fbcd9d66d16a4cfbc0ee95baaf03/raw/cc50d06367ab34984bce199e09686cfd83ba8251/multi-worker-kind-cluster.yaml -o multi-node-cluster.yamlkind create cluster --config multi-node-cluster.yaml --name multi-node-cluster
3. Provisioning a Multi-Node with additional configuration
Besides specifying the additional nodes we can specify additional configurations such as the following.
- Custom Image
- KubeAPI-Server details
- Extra Port Mappings
More details around (https://kind.sigs.k8s.io/docs/user/configuration/)
curl https://gist.githubusercontent.com/chrisedrego/0c887eb5f34409da6beff3e3fbaf01b6/raw/e3776753c8561b46e1774faf7c966c1061cc77cf/multi-node-cluster-custom.yaml -o multi-node-cluster-custom.yamlkind create cluster --config multi-node-cluster-custom.yaml --name multi-node-cluster-custom
Managing Clusters
kind provides a simple to use cli which allows to create, get, delete clusters
Get Clusters
We can list the available clusters using the following command
kind get clusters
Delete Clusters
We can delete the available clusters using the following command
kind delete cluster --name=my-simple-cluster