找回密码
 立即注册
首页 业界区 科技 minikube安裝分享

minikube安裝分享

亢安芙 5 小时前

  • 安装步骤

    • 拉取镜像
      1. [root@localhost ~]# curl -Lo minikube https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/v1.23.1/minikube-linux-amd64
      2.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
      3.                                  Dload  Upload   Total   Spent    Left  Speed
      4. 100 65.0M  100 65.0M    0     0  8962k      0  0:00:07  0:00:07 --:--:-- 9998k
      5. [root@localhost ~]# chmod +x minikube && sudo mv minikube /usr/local/bin/
      6. [root@localhost ~]# minikube version
      7. minikube version: v1.23.1
      复制代码
    • 尝试启动
      之前使用了老版本启动了集群,按照要求删掉,可正常继续
      1. [root@localhost ~]# minikube start --driver=none
      2. * Centos 7.9.2009 上的 minikube v1.23.1
      3. ! Deleting existing cluster minikube with different driver docker due to --delete-on-failure flag set by the user.
      4. ! Exiting due to GUEST_DRIVER_MISMATCH: The existing "minikube" cluster was created using the "docker" driver, which is incompatible with requested "none" driver.
      5. * 建议:Delete the existing 'minikube' cluster using: 'minikube delete', or start the existing 'minikube' cluster using: 'minikube start --driver=docker'
      6. [root@localhost ~]# minikube delete
      7. * 正在删除 docker 中的“minikube”…
      8. * Removed all traces of the "minikube" cluster.
      复制代码
    • 尝试启动第二次
      在虚拟机中使用,不能使用--driver=docker
      ((20250608194804-0hepayr '为什么在虚拟机中启动minikube 不能使用 --driver=docker'))
      1. [root@localhost ~]# minikube start --driver=docker
      2. * Centos 7.9.2009 上的 minikube v1.23.1
      3. * 根据现有的配置文件使用 docker 驱动程序
      4. * The "docker" driver should not be used with root privileges.
      5. * If you are running minikube within a VM, consider using --driver=none:
      复制代码
    • 尝试启动第三次
      缺少依赖,安装sudo yum install -y conntrack-tools 后解决
      ((20250608195127-e9l4a1a '为什么使用 minikube 需要安装 conntrack-tools'))
      1. [root@localhost ~]# minikube start --driver=none
      2. * Centos 7.9.2009 上的 minikube v1.23.1
      3. * 根据用户配置使用 none 驱动程序
      4. X Exiting due to GUEST_MISSING_CONNTRACK: Sorry, Kubernetes 1.22.1 requires conntrack to be installed in root's path
      复制代码
    • 安装成功记录
      1. [root@localhost ~]# minikube start --driver=none
      2. * Centos 7.9.2009 上的 minikube v1.23.1
      3. * 根据用户配置使用 none 驱动程序
      4. * minikube 1.35.0 is available! Download it: https://github.com/kubernetes/minikube/releases/tag/v1.35.0
      5. * To disable this notice, run: 'minikube config set WantUpdateNotification false'
      6. * Starting control plane node minikube in cluster minikube
      7. * Running on localhost (CPUs=4, Memory=15885MB, Disk=173995MB) ...
      8. * OS release is CentOS Linux 7 (Core)
      9.     > kubelet.sha256: 64 B / 64 B [--------------------------] 100.00% ? p/s 0s                                                                                                                                               \
      10.     > kubelet: 146.25 MiB / 146.25 MiB [-------------] 100.00% 4.31 MiB p/s 34s
      11.   - Generating certificates and keys ...
      12.   - Booting up control plane ...
      13.   - Configuring RBAC rules ...
      14. * 开始配置本地主机环境...
      15. *
      16. ! The 'none' driver is designed for experts who need to integrate with an existing VM
      17. * Most users should use the newer 'docker' driver instead, which does not require root!
      18. * For more information, see: https://minikube.sigs.k8s.io/docs/reference/drivers/none/
      19. *
      20. ! kubectl 和 minikube 配置将存储在 /root 中
      21. ! 如需以您自己的用户身份使用 kubectl 或 minikube 命令,您可能需要重新定位该命令。例如,如需覆盖您的自定义设置,请运行:
      22. *
      23.   - sudo mv /root/.kube /root/.minikube $HOME
      24.   - sudo chown -R $USER $HOME/.kube $HOME/.minikube
      25. *
      26. * 此操作还可通过设置环境变量 CHANGE_MINIKUBE_NONE_USER=true 自动完成
      27. * Verifying Kubernetes components...
      28.   - Using image registry.cn-hangzhou.aliyuncs.com/google_containers/storage-provisioner:v5
      29. * Enabled addons: storage-provisioner, default-storageclass
      30. ! /usr/local/bin/kubectl is version 1.33.1, which may have incompatibilites with Kubernetes 1.22.1.
      31.   - Want kubectl v1.22.1? Try 'minikube kubectl -- get pods -A'
      32. * Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
      复制代码
    • 安装控制台
      ((20250608200637-mxnym1p 'minikube dashboard 如何外部访问'))
      1. [root@localhost ~]# minikube dashboard --url
      2. * 正在验证 dashboard 运行情况 ...
      3. * Launching proxy ...
      4. * 正在验证 proxy 运行状况 ...
      5. 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/
      1.png



来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
您需要登录后才可以回帖 登录 | 立即注册