win11使用minikube搭建K8S集群基于podman desktop( Fedora Linux 43)

文章目录

minikube搭建K8S集群基于Fedora Linux 43系统

win11安装podman desktop

bash 复制代码
# 静默 Windows 安装程序
podman-desktop-1.6.4-setup-x64.exe /S
# 或者 使用Chocolatey安装
choco install podman-desktop

安装minikube

bash 复制代码
curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
rm minikube-linux-amd64

minikube start

复制代码
minikube start -p minikube2 --driver=podman \
--container-runtime=cri-o \
--kubernetes-version='1.32'

查看集群

bash 复制代码
minikube -p minikube2 kubectl -- get pods -A

minikube profile list

minikube profile minikube2

minikube kubectl -- get pods -A

alias kubectl="minikube kubectl --"

kubectl get pods -A

停止集群 minikube stop

下次启动集群 minikube start


参考

配置别名

bash 复制代码
echo 'alias kubectl="minikube kubectl --"' >> ~/.bashrc
echo 'alias mini="minikube"' >> ~/.bashrc
source ~/.bashrc

安装nano

bash 复制代码
sudo dnf install nano

配置Fedora Linux加速

用以下命令替换 /etc/yum.repos.d 下的文件:

bash 复制代码
sudo sed -e 's|^metalink=|#metalink=|g' \
         -e 's|^#baseurl=http://download.example/pub/fedora/linux|baseurl=https://mirrors.ustc.edu.cn/fedora|g' \
         -i.bak \
         /etc/yum.repos.d/fedora.repo \
         /etc/yum.repos.d/fedora-updates.repo

最后运行 sudo dnf makecache 生成缓存。


配置podman镜像加速

wsl使用podman镜像加速

bash 复制代码
cat /etc/containers/registries.conf.d/custom.conf

sudo nano /etc/containers/registries.conf.d/custom.conf

添加以下内容

bash 复制代码
unqualified-search-registries = ['docker.io', 'k8s.gcr.io', 'gcr.io']

[[registry]]
prefix = "docker.io"
insecure = true
location = "registry-1.docker.io"

[[registry.mirror]]
location = "docker.1ms.run"

[[registry]]
prefix = "k8s.gcr.io"
insecure = true
location = "k8s.gcr.io"

[[registry.mirror]]
location = "registry.cn-hangzhou.aliyuncs.com/google_containers"

[[registry]]
prefix = "gcr.io"
insecure = true
location = "gcr.io"

[[registry.mirror]]
location = "registry.cn-hangzhou.aliyuncs.com/google_containers"

[[registry]]
prefix = "ghcr.io"
insecure = true
location = "ghcr.io"

[[registry.mirror]]
location = "registry.cn-hangzhou.aliyuncs.com/google_containers"

保存并退出:Ctrl + O → 回车 → Ctrl + X


查看系统版本

复制代码
$ cat /etc/fedora-release
Fedora release 43 (Forty Three)

设置root用户密码

bash 复制代码
sudo passwd root

切换用户

bash 复制代码
su user
cd /home/user
pwd

相关推荐
林三的日常几秒前
AI编程工具后端选型指南
ai编程
不爱洗脚的小滕2 分钟前
【Agent】如何为 AI Agent 设计高可用的 Tools
人工智能·aigc·ai编程·rag
Moshow郑锴39 分钟前
Ubuntu 26.04 更换阿里云源镜像
linux·运维·ubuntu
Code_Artist41 分钟前
🦜用 GoAI 从零打造一个 AI Agent 脚手架工程:重新定义智能体开发范式!
go·agent·ai编程
Jason_chen1 小时前
Linux 6.2 串口机制深度解析:AI驱动的自适应通信与零信任串口安全架构
linux
ZzT1 小时前
费时费力做的 Spec 和知识库,Agent 真的受到约束了么?
openai·ai编程·claude
ShineWinsu2 小时前
对于Linux:线程概念与分页存储管理的解析
linux·运维·服务器·面试·线程·进程·虚拟空间地址
用户3946235365242 小时前
Uboot - DM框架
linux
li-xun2 小时前
Claude 关闭 Fable 5 / Mythos 5 模型?付费用户能退款吗?
ai编程
凯旋.Lau3 小时前
Claude Code辅助软件开发实用教程
ai编程