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

会出现如下界面:

搞定

相关推荐
阿里云云原生1 小时前
【云栖大会】AI原生、AI可观测、AI Serverless、AI中间件,4场论坛20+议题公布!
云原生
容器魔方2 小时前
Bloomberg 正式加入 Karmada 用户组!
云原生·容器·云计算
muyun28007 小时前
Docker 下部署 Elasticsearch 8 并集成 Kibana 和 IK 分词器
elasticsearch·docker·容器
Nazi68 小时前
k8s的dashboard
云原生·容器·kubernetes
傻傻虎虎12 小时前
【Docker】常用帮忙、镜像、容器、其他命令合集(2)
运维·docker·容器
是小崔啊13 小时前
叩丁狼K8s - 概念篇
云原生·容器·kubernetes
AKAMAI19 小时前
Sport Network 凭借 Akamai 实现卓越成就
人工智能·云原生·云计算
ajax_beijing20 小时前
zookeeper是啥
分布式·zookeeper·云原生
summer_west_fish21 小时前
2023年系统分析师上半年论文试题分析
kubernetes
LeeZhao@21 小时前
【AI推理部署】Docker篇04—Docker自动构建镜像
人工智能·docker·容器