安装minikube

 

Install kubectl binary with curl on Linux
  https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
minikube
  https://minikube.sigs.k8s.io/docs/start/

 

遇到的问题:

X Exiting due to MK_USAGE: 'none' driver does not support 'minikube ssh' command

解决:

adduser alpha
usermod -aG docker alpha && newgrp docker
su - alpha
minikube start --driver=docker

kubectl get pods

  ImagePullBackOff

The status ImagePullBackOff means that a Pod couldn’t start because Kubernetes could not pull a container image. The ‘BackOff’ part indicates that Kubernetes will keep trying to pull the image, with an increasing back-off delay.

 原因:! minikube was unable to download gcr.io/k8s-minikube/kicbase:v0.0.27, but successfully downloaded docker.io/kicbase/stable:v0.0.27 as a fallback image

,应该是镜像拉取不下来。

解决:

minikube start --image-mirror-country cn --iso-url=https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.5.0.iso --registry-mirror=https://pe3ox7bd.mirror.aliyuncs.com --driver=docker --memory=2048

 

Create a sample deployment and expose it on port 8080:

  

1
2
3
kubectl create deployment hello-minikube --image=registry.cn-hangzhou.aliyuncs.com/google_containers/echoserver:1.4
 
kubectl expose deployment hello-minikube --type=NodePort --port=8080

 

 

访问:NodePort

kubectl get svc

minikube service mysvc, url浏览器访问  

 

执行

minikube tunnel

报错:

errors: 
                minikube: no errors
                router: no errors
                loadbalancer emulator: no errors

解决:

Please keep in mind that minikube tunnel session must be opened whole the time otherwise your LB will stop getting IP address.

1
kubectl get services balanced

 

链接:https://stackoverflow.com/questions/58790433/cannot-export-a-ip-in-minikube-and-haproxy-loadbalancer

 

参考链接:

https://zhuanlan.zhihu.com/p/241030384
https://v1-18.docs.kubernetes.io/zh/docs/setup/learning-environment/minikube/

https://stackoverflow.com/questions/52698748/connection-refused-on-pushing-a-docker-image

https://stackoverflow.com/questions/68984450/minikube-why-the-docker-driver-should-not-be-used-with-root-privileges
https://www.ithands-on.com/2020/12/minikube-101-error-exiting-due-to.html

posted @   parkdifferent  阅读(400)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
点击右上角即可分享
微信分享提示