如何启动Kubernetes?

sqserrrh  于 2023-08-03  发布在  Kubernetes
关注(0)|答案(1)|浏览(105)

我已经在NixOS 22.05上安装了Kubernetes和Minikube。但我无法启动Kubernetes:

minikube start --driver=docker

字符串
输出量:

😄  minikube v1.25.2 on Nixos 22.05 (Quokka)
    ▪ MINIKUBE_WANTUPDATENOTIFICATION=false
✨  Using the docker driver based on user configuration

💣  Exiting due to PROVIDER_DOCKER_NEWGRP: "docker version --format -" exit status 1: Got 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
💡  Suggestion: Add your user to the 'docker' group: 'sudo usermod -aG docker $USER && newgrp docker'
📘  Documentation: https://docs.docker.com/engine/install/linux-postinstall/


我按照建议将我添加到组docker:

sudo groupadd docker


输出量:

[sudo] password for t:
groupadd: group 'docker' already exists


还有:

sudo gpasswd -a $USER docker


输出量:

Adding user t to group docker


还有:

newgrp docker


但它仍然不起作用:

minikube start --driver=docker


输出量:

😄  minikube v1.25.2 on Nixos 22.05 (Quokka)
    ▪ MINIKUBE_WANTUPDATENOTIFICATION=false
✨  Using the docker driver based on user configuration

💣  Exiting due to PROVIDER_DOCKER_NEWGRP: "docker version --format -" exit status 1: Got 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
💡  Suggestion: Add your user to the 'docker' group: 'sudo usermod -aG docker $USER && newgrp docker'
📘  Documentation: https://docs.docker.com/engine/install/linux-postinstall/


我该怎么办?

vqlkdk9b

vqlkdk9b1#

我试着在很多方面都一样。

curl -fsSL https://get.docker.com/rootless | sh

个字符
什么都不管用。。但最后,运行下面的命令工作.

docker context use default


这解决了我的问题。

相关问题