-
安裝步驟
-
拉取鏡像
[root@localhost ~]# curl -Lo minikube https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/v1.23.1/minikube-linux-amd64 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 65.0M 100 65.0M 0 0 8962k 0 0:00:07 0:00:07 --:--:-- 9998k [root@localhost ~]# chmod +x minikube && sudo mv minikube /usr/local/bin/ [root@localhost ~]# minikube version minikube version: v1.23.1 -
嘗試啓動
之前使用了老版本啓動了集羣,按照要求刪掉,可正常繼續
[root@localhost ~]# minikube start --driver=none * Centos 7.9.2009 上的 minikube v1.23.1 ! Deleting existing cluster minikube with different driver docker due to --delete-on-failure flag set by the user. ! Exiting due to GUEST_DRIVER_MISMATCH: The existing "minikube" cluster was created using the "docker" driver, which is incompatible with requested "none" driver. * 建議:Delete the existing 'minikube' cluster using: 'minikube delete', or start the existing 'minikube' cluster using: 'minikube start --driver=docker' [root@localhost ~]# minikube delete * 正在刪除 docker 中的“minikube”… * Removed all traces of the "minikube" cluster. -
嘗試啓動第二次
在虛擬機中使用,不能使用--driver=docker
((20250608194804-0hepayr '為什麼在虛擬機中啓動minikube 不能使用 --driver=docker'))
[root@localhost ~]# minikube start --driver=docker * Centos 7.9.2009 上的 minikube v1.23.1 * 根據現有的配置文件使用 docker 驅動程序 * The "docker" driver should not be used with root privileges. * If you are running minikube within a VM, consider using --driver=none: -
嘗試啓動第三次
缺少依賴,安裝sudo yum install -y conntrack-tools 後解決
((20250608195127-e9l4a1a '為什麼使用 minikube 需要安裝 conntrack-tools'))
[root@localhost ~]# minikube start --driver=none * Centos 7.9.2009 上的 minikube v1.23.1 * 根據用户配置使用 none 驅動程序 X Exiting due to GUEST_MISSING_CONNTRACK: Sorry, Kubernetes 1.22.1 requires conntrack to be installed in root's path -
安裝成功記錄
[root@localhost ~]# minikube start --driver=none * Centos 7.9.2009 上的 minikube v1.23.1 * 根據用户配置使用 none 驅動程序 * minikube 1.35.0 is available! Download it: https://github.com/kubernetes/minikube/releases/tag/v1.35.0 * To disable this notice, run: 'minikube config set WantUpdateNotification false' * Starting control plane node minikube in cluster minikube * Running on localhost (CPUs=4, Memory=15885MB, Disk=173995MB) ... * OS release is CentOS Linux 7 (Core) > kubelet.sha256: 64 B / 64 B [--------------------------] 100.00% ? p/s 0s \ > kubelet: 146.25 MiB / 146.25 MiB [-------------] 100.00% 4.31 MiB p/s 34s - Generating certificates and keys ... - Booting up control plane ... - Configuring RBAC rules ... * 開始配置本地主機環境... * ! The 'none' driver is designed for experts who need to integrate with an existing VM * Most users should use the newer 'docker' driver instead, which does not require root! * For more information, see: https://minikube.sigs.k8s.io/docs/reference/drivers/none/ * ! kubectl 和 minikube 配置將存儲在 /root 中 ! 如需以您自己的用户身份使用 kubectl 或 minikube 命令,您可能需要重新定位該命令。例如,如需覆蓋您的自定義設置,請運行: * - sudo mv /root/.kube /root/.minikube $HOME - sudo chown -R $USER $HOME/.kube $HOME/.minikube * * 此操作還可通過設置環境變量 CHANGE_MINIKUBE_NONE_USER=true 自動完成 * Verifying Kubernetes components... - Using image registry.cn-hangzhou.aliyuncs.com/google_containers/storage-provisioner:v5 * Enabled addons: storage-provisioner, default-storageclass ! /usr/local/bin/kubectl is version 1.33.1, which may have incompatibilites with Kubernetes 1.22.1. - Want kubectl v1.22.1? Try 'minikube kubectl -- get pods -A' * Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default -
安裝控制枱
((20250608200637-mxnym1p 'minikube dashboard 如何外部訪問'))
[root@localhost ~]# minikube dashboard --url * 正在驗證 dashboard 運行情況 ... * Launching proxy ... * 正在驗證 proxy 運行狀況 ... http://127.0.0.1:36988/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ -
成功訪問控制枱
http://127.0.0.1:36988→8000/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/![image]()
-
