docker 安装
安装docker desktop(略)
下载kind
https://github.com/kubernetes-sigs/kind
下载后修改为"kind.exe"即可
curl.exe -Lo kind-windows-amd64.exe https://kind.sigs.k8s.io/dl/v0.14.0/kind-windows-amd64
Move-Item .\kind-windows-amd64.exe c:\some-dir-in-your-PATH\kind.exe
kind操作
配置文件
# three node (two workers) cluster config
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 80
hostPort: 80
listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0"
protocol: udp # Optional, defaults to tcp
- role: worker
- role: worker
kind create cluster --name kind-2 --config kind-example-config.yaml # 创建集群
kind delete cluster # 删除集群
kind get clusters # 查询
kind load docker-image my-custom-image-0 my-custom-image-1
kind load image-archive /my-image-archive.tar
# You can get a list of images present on a cluster node
docker exec -it kind-control-plane crictl images
kind export logs ./somedir
下载k3d
从https://github.com/k3d-io/k3d/releases下载对应的exe程序
k3d操作
k3d cluster create mycluster --servers 3 --agents2
context切换
kubectl config get-contexts
kubectl config use-context xxxx