window本地安装k8s集群,用Minikube安装

先把防火墙关闭,否则安装会提示如下错误:

X 因 INET_DOWNLOAD_BLOCKED 错误而退出:update primary control-plane node: downloading binaries: downloading kubelet: download failed: https://dl.k8s.io/release/v1.30.0/bin/linux/amd64/kubelet?checksum=file:https://dl.k8s.io/release/v1.30.0/bin/linux/amd64/kubelet.sha256: getter: &{Ctx:context.Background Src:https://dl.k8s.io/release/v1.30.0/bin/linux/amd64/kubelet?checksum=file:https://dl.k8s.io/release/v1.30.0/bin/linux/amd64/kubelet.sha256 Dst:D:\minikube\.minikube\cache\linux\amd64\v1.30.0/kubelet.download Pwd: Mode:2 Umask:---------- Detectors:[0x4f92a00 0x4f92a00 0x4f92a00 0x4f92a00 0x4f92a00 0x4f92a00 0x4f92a00] Decompressors:map[bz2:0xc000a814c0 gz:0xc000a814c8 tar:0xc000a81470 tar.bz2:0xc000a81480 tar.gz:0xc000a81490 tar.xz:0xc000a814a0 tar.zst:0xc000a814b0 tbz2:0xc000a81480 tgz:0xc000a81490 txz:0xc000a814a0 tzst:0xc000a814b0 xz:0xc000a814d0 zip:0xc000a814e0 zst:0xc000a814d8] Getters:map[file:0xc001f34900 http:0xc000c939a0 https:0xc000c939f0] Dir:false ProgressListener:0x4ef8d30 Insecure:false DisableSymlinks:false Options:[0x18b80a0]}: read tcp 26.26.26.1:57562->151.101.129.55:443: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. * 建议:防火墙可能会阻止 minikube 访问互联网。您可能需要将 minikube 配置为使用 * 文档:https://minikube.sigs.k8s.io/docs/handbook/vpn_and_proxy/ * 相关问题: - https://github.com/kubernetes/minikube/issues/3922 - https://github.com/kubernetes/minikube/issues/6109 - https://github.com/kubernetes/minikube/issues/6123

编写一个文件,名称:Hyper-V Installer.cmd,执行文件,内容如下:

pushd "%~dp0" dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i" del hyper-v.txt Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL

执行完就安装了Hyper-V了

下载安装minikube-installer.exe

MINIKUBE_HOME env变量设置.minikube目录的路径。比如我的环境变量是这么设置的。

最后产生的.minikube就在D:\minikube中。

启动集群:

minikube start --registry-mirror=https://registry.docker-cn.com --image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers --memory=4096

安装完成提示

执行命令

minikube dashboard

输出:会自动打开浏览器

W0807 09:10:07.798404 1588 main.go:291] Unable to resolve the current Docker CLI context "default": context "default": context not found: open C:\Users\33409\.docker\contexts\meta\37a8eec1ce19687d132fe29051dca629d164e2c4958ba141d5f4133a33f0688f\meta.json: The system cannot find the path specified. * 正在开启 dashboard ... - 正在使用镜像 docker.io/kubernetesui/dashboard:v2.7.0 - 正在使用镜像 docker.io/kubernetesui/metrics-scraper:v1.0.8 * Some dashboard features require the metrics-server addon. To enable all features please run: minikube addons enable metrics-server * 正在验证 dashboard 运行情况 ... * 正在启动代理... * 正在验证 proxy 运行状况 ... * 正在使用默认浏览器打开 http://127.0.0.1:37030/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ ...

会出现如下界面:

搞定

相关推荐
JunLan~3 小时前
Rocky Linux 系统安装/部署 Docker
linux·docker·容器
小袁搬码7 小时前
Windows中指定路径安装DockerDesktop
windows·docker·容器·docker desktop
qq_312920117 小时前
docker 部署 kvm 图形化管理工具 WebVirtMgr
运维·docker·容器
踏雪Vernon7 小时前
[OpenHarmony5.0][Docker][环境]OpenHarmony5.0 Docker编译环境镜像下载以及使用方式
linux·docker·容器·harmonyos
条纹布鲁斯8 小时前
dockerdsktop修改安装路径/k8s部署wordpress和ubuntu
docker·kubernetes
CP-DD10 小时前
Docker 容器化开发 应用
运维·docker·容器
老司机张师傅11 小时前
【微服务实战之Docker容器】第七章-Dockerfile解析
容器·dockerfile·虚悬镜像·docker学习
登云时刻11 小时前
Kubernetes集群外连接redis集群和使用redis-shake工具迁移数据(一)
redis·kubernetes·bootstrap
运维&陈同学12 小时前
【zookeeper03】消息队列与微服务之zookeeper集群部署
linux·微服务·zookeeper·云原生·消息队列·云计算·java-zookeeper
吴半杯12 小时前
gateway漏洞(CVE-2022-22947)
docker·kubernetes·gateway