1. 安装docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
2. 安装k3d
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
在环境变量加入以下配置,进行镜像加速
export K3D_DOCKER_OPTIONS="--registry-mirror=https://8km017g6.mirror.aliyuncs.com"
3. 创建k3d集群
k3d cluster create
kubectl get all --all-namespaces
kubectl get nodes
kubectl cluster-info
4. 暴露traefik端口
kubectl -n kube-system port-forward $(kubectl -n kube-system get pods --selector "app.kubernetes.io/name=traefik" --output=name) --address 0.0.0.0 9000:9000
打开页面:http://localhost:9000/dashboard/#/