wsl minikube的简单应用

2023-12-18 19:52:10

minikube

  • minikube官网:https://minikube.sigs.k8s.io/docs/
  • minikube是容器编排与管理的工具,本机事先已经安装了docker
  • 进入minikube官网,点Get Started!长这熊样 在这里插入图片描述
    看一硬件要求
    • CPU 核心数 >= 2
    • 内存 2GB
    • 磁盘 20GB
    • 网络连接
    • 容器或虚拟机管理器,如:docker…
    • 此时下滑,看一下安装步骤

开始安装

  1. 选择合适自己的安装包,我这里选Linux、ARM64、Stable、Binary
    然后捏,复制下边的curl指令,粘贴进命令行,安装即可在这里插入图片描述
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-arm64
sudo install minikube-linux-arm64 /usr/local/bin/minikube
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 86.6M  100 86.6M    0     0    14.7M         0  0:00:05  0:00:05 --:--:-- 18.9M
  1. minikube start
minikube start
😄  minikube v1.32.0 on Ubuntu 22.04 (arm64)
?  Automatically selected the docker driver. Other choices: none, ssh
🛑  The "docker" driver should not be used with root privileges. If you wish to continue as root, use --force.
💡  If you are running minikube within a VM, consider using --driver=none:
📘    https://minikube.sigs.k8s.io/docs/reference/drivers/none/

?  Exiting due to DRV_AS_ROOT: The "docker" driver should not be used with root privileges.

出错了,它说不让在root权限下运行
此时exit出root用户,再次执行

minikube start
😄  minikube v1.32.0 on Ubuntu 22.04 (arm64)
👎  Unable to pick a default driver. Here is what was considered, in preference order:
     ? docker: Not healthy: "docker version --format {{.Server.Os}}-{{.Server.Version}}:{{.Server.Platform.Name}}" exit status 1: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version": dial unix /var/run/docker.sock: connect: permission denied
     ? docker: Suggestion: Add your user to the 'docker' group: 'sudo usermod -aG docker $USER && newgrp docker' <https://docs.docker.com/engine/install/linux-postinstall/>
💡  Alternatively you could install one of these drivers:
     ? kvm2: Not installed: exec: "virsh": executable file not found in $PATH
     ? qemu2: Not installed: exec: "qemu-system-aarch64": executable file not found in $PATH
     ? podman: Not installed: exec: "podman": executable file not found in $PATH
     ? virtualbox: Not installed: unable to find VBoxManage in $PATH

?  Exiting due to DRV_NOT_HEALTHY: Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.

又出错了,它给出了docker安装的建议:
Add your user to the 'docker' group: 'sudo usermod -aG docker $USER && newgrp docker

执行它:sudo usermod -aG docker $USER && newgrp docker

然后再执行它:minikube start 在这里插入图片描述 此时发现minikube启动成功了

  1. 执行 kubectl get po -A,发现如下错误
Command 'kubectl' not found, but can be installed with:
sudo snap install kubectl

那就先安kubectl:https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/

执行: curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl",拉取二进制文件

执行:kubectl version,查看是否安装成功

Client Version: v1.29.0
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.3

执行:minikube dashboard
打开在浏览器中打开控制面板查看minikube信息
在这里插入图片描述
在这里插入图片描述此时看一下windows内存剩余,wsl占用还是可以接受的
在这里插入图片描述
在这里插入图片描述使用:minikube stop 关闭minikube
在这里插入图片描述

文章来源:https://blog.csdn.net/dawnto/article/details/135068985
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。