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/#/