minikube安裝分享

  1. 安装步骤

    1. 拉取镜像

      [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
      
    2. 尝试启动

      之前使用了老版本启动了集群,按照要求删掉,可正常继续

      [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.
      
      
    3. 尝试启动第二次

      在虚拟机中使用,不能使用--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:
      
    4. 尝试启动第三次

      缺少依赖,安装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
      
      
    5. 安装成功记录

      [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
      
      
    6. 安装控制台

      ((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/
      
    7. 成功访问控制台
      http://127.0.0.1:36988→8000/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/

      image

posted @ 2025-08-05 10:48  箛獨劍  阅读(25)  评论(0)    收藏  举报