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

会出现如下界面:

搞定

相关推荐
铃木隼.2 小时前
docker容器高级管理-dockerfile创建镜像
运维·docker·容器
容器魔方2 小时前
持续领跑,华为云连续5年蝉联中国容器软件市场份额第一
云原生·容器·云计算
樽酒ﻬق5 小时前
Prometheus Operator:Kubernetes 监控自动化实践
java·算法·云原生·运维开发
麟城Lincoln7 小时前
【Linux-云原生-笔记】Apache相关
linux·笔记·云原生·apache·webserver
IT成长日记8 小时前
【Docker基础】Dockerfile指令速览:文件与目录操作指令详解
docker·容器·volume·add·dockerfile·workdir
胡耀超8 小时前
GraphRAG Docker化部署,接入本地Ollama完整技术指南:从零基础到生产部署的系统性知识体系
运维·docker·容器·大模型·知识图谱·rag·ollama
Continue_with18 小时前
docker设置代理
运维·docker·容器
彭泽布衣18 小时前
远程登录docker执行shell报错input is not a terminal问题
运维·docker·容器
炫爱小七18 小时前
包稳定的Docker 安装方式(CentOS)
docker·容器·centos
搂……住19 小时前
shiro550反序列化漏洞复现(附带docker源)
安全·docker·容器