The instructions in this tutorial are not WSL2 specific, but if you would like to see how to get started with kind in WSL2 (and afterwards follow along with this tutorial), do have a look at this video.
In order to create a multi-node cluster with kind, we need to create a configuration file. Let's say we want to create a 3 node cluster, 1 control-plane and 2 workers, we would then create the following configuration file (you can save it as kind-config.yaml
):
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
- role: worker
- role: worker
To create a cluster using this configuration file we need to run kind create cluster --name kind-cluster --config kind-config.yaml
. The --config
option takes a path to the configuration file, so make sure to adjust it accordingly to correctly point to your kind config file.
First, we need to figure out what versions are available. Since kind uses docker images for each node, let's go to Docker Hub and see what is available: https://hub.docker.com/r/kindest/node
If for example, we want to create a kind cluster that uses Kubernetes 1.17.5 using the kind config above, we would run kind create cluster --image "kindest/node:v1.17.5" --name kind-cluster --config kind-config.yaml