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:mapbz2: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:mapfile: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/ ...

会出现如下界面:

搞定

相关推荐
阿里云云原生2 天前
研发视角的新突破:当 AI Coding 工具集成全域运维诊断,排查线上故障只需 3 分钟
云原生
小猿姐2 天前
唯品会大规模数据库云原生实践:基于 KubeBlocks 管理数千实例的统一运维之路
运维·elasticsearch·云原生
阿里云云原生3 天前
AgentTeams 和 Claude Tag 都进入群聊模式,是新范式还是新叙事?
云原生·agent
阿里云云原生4 天前
Higress v2.2.3 发布:正式入驻 CNCF Sandbox,AI Gateway 与 Ingress 迁移能力双向加固
云原生
lichenyang4534 天前
Docker 学习笔记(四):Dockerfile,把项目打成自己的镜像
docker·容器
lichenyang4534 天前
Docker 学习笔记(三):Docker 网络、bridge、子网和容器互通
docker·容器
lichenyang4534 天前
Docker 学习笔记(二):docker run 的参数到底在控制什么?
docker·容器
阿里云云原生5 天前
香港站【企业 AI Agent 工程化实战专场】来啦,邀您7月9日见!
云原生·agent
阿里云云原生5 天前
研发域与运维域的“数字握手”:通过 Agentic Skills 实现 DevOps 全链路自动化
云原生
运维开发故事7 天前
基于 Arthas 的多集群在线诊断系统设计与实现
kubernetes