34 lines
977 B
Markdown
34 lines
977 B
Markdown
# monitor
|
|
|
|
operator demo
|
|
|
|
* 测试环境
|
|
|
|
```bash
|
|
# 安装 KinD
|
|
sudo curl -Lo /usr/local/bin/kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64 && sudo chmod +x /usr/local/bin/kind
|
|
|
|
docker network create kind -o com.docker.network.bridge.name=br-kind
|
|
# 部署镜像仓库
|
|
docker run --restart always --network kind --name registry --tmpfs /var/lib/registry -p 0.0.0.0:5000:5000 -d registry:2
|
|
# 创建带有本地镜像仓库的集群
|
|
kind create cluster --image kindest/node:v1.24.15 --config=- <<EOF
|
|
kind: Cluster
|
|
apiVersion: kind.x-k8s.io/v1alpha4
|
|
networking:
|
|
apiServerPort: 6443
|
|
podSubnet: 172.16.0.0/16
|
|
serviceSubnet: 172.19.0.0/16
|
|
nodes:
|
|
- role: control-plane
|
|
- role: worker
|
|
- role: worker
|
|
containerdConfigPatches:
|
|
- |-
|
|
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
|
|
endpoint = ["https://hub-mirror.c.163.com"]
|
|
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5000"]
|
|
endpoint = ["http://registry:5000"]
|
|
EOF
|
|
```
|