kind (multi-node k8s cluster): Quick Start on Mac

This post shows an example usage of kind on Mac.


what is kind?

kind lets you create a k8s cluster with multiple nodes on docker.

You need docker & kubectl to run it.


install

% docker -v

Docker version 20.10.5, build 55c4c88

% kubectl version

... v1.19.7 ...

% brew install kind

% kind --version

kind version 0.11.0


one-node cluster

You can create a one-node cluster by default.

The initial creation may take a few minutes longer to load the image.

% kind create cluster

% kubectl get node

NAME                 STATUS     ROLES                  AGE   VERSION

kind-control-plane   NotReady   control-plane,master   30s   v1.21.1

% kind delete cluster


multi-node cluster

Passing a config file (--config) lets you create a cluster with multiple nodes.

The following example will create 3 controle-planes & 3 workers.

% cat kind.yaml 

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: control-plane
- role: control-plane
- role: worker
- role: worker
- role: worker

% kind create cluster --config kind.yaml

% kubectl get node

NAME                  STATUS     ROLES                  AGE    VERSION
kind-control-plane    Ready      control-plane,master   113s   v1.21.1
kind-control-plane2   Ready      control-plane,master   85s    v1.21.1
kind-control-plane3   Ready      control-plane,master   25s    v1.21.1
kind-worker           NotReady   <none>                 12s    v1.21.1
kind-worker2          NotReady   <none>                 12s    v1.21.1
kind-worker3          NotReady   <none>                 12s    v1.21.1

% kind delete cluster


Comments

Popular posts from this blog

Minikube Installation for M1 Mac

Selenide: Quick Start

PyCharm: Quick Start