Think before you speak, read before you think.

Local K8s cluster: kind

Use kind to spin up a new cluster

brew install kind

Create an ha cluster, 3 control-plane, 3 nodes

$ mkdir kind-cluster
$ cd kind-cluster
$ bash -x ha-bootstrap.sh

kubectl cluster-info –context kind-ha-dev

It’s not stable after docker desktop restarted

$ kubectx
Switched to context “kind-ha-dev”.
$ kubectl get pods
E0515 09:10:08.836178 38742 memcache.go:265] couldn’t get current server API group list: Get “https://127.0.0.1:50016/api?timeout=32s”: EOF

$ kind delete cluster –name ha-dev
Deleting cluster “dev” …
Deleted nodes: [“dev-external-load-balancer” “dev-control-plane3” “dev-control-plane2” “dev-worker” “dev-worker2” “dev-worker3” “dev-control-plane”]

Create 1 control-plane, 1 node cluster

$ bash -x single-bootstrap.sh

Get clusters

$ kind get clusters
dev
ha-dev

source code: https://github.com/jpuyy/local-k8s-gitops/tree/main/kind-cluster


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *