如何在 MacBook 上连接 Hyperkit 上的 Minikube

How to connect Minikube on Hyperkit on MacBook

我正在尝试连接到 Hyperkit 以检查此 VM 上的容器 运行。

我现在得到的是[screen is terminating]

这是我的做法:

MacBook-Pro-Karol:  ~
→ minikube start --driver=hyperkit
  minikube v1.12.3 na Darwin 10.15.6
✨  Using the hyperkit driver based on user configuration
  Starting control plane node minikube in cluster minikube
  Creating hyperkit VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
  preparing Kubernetes v1.18.3 on Docker 19.03.12...
  Verifying Kubernetes components...
  Enabled addons: default-storageclass, storage-provisioner
  Ready! kubectl is configured to be used with "minikube".

MacBook-Pro-Karol:  ~
→ sudo screen /Users/karol/.minikube/machines/minikube/tty
Password:
[screen is terminating]

MacBook-Pro-Karol:  ~
→ screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
[screen is terminating]

Cannot exec '/Users/karol/Library/Containers/com.docker.docker/Data/vms/0/tty': Permission denied

→ sudo screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
Password:
[screen is terminating]

Cannot exec '/Users/karol/Library/Containers/com.docker.docker/Data/vms/0/tty': Operation not permitted

如有任何帮助,我们将不胜感激。

您可以使用 minikube sshlogin 进入运行 minikube 的虚拟机:

Log into or run a command on a machine with SSH; similar to ‘docker-machine ssh’.

minikube ssh [flags]

然后使用 docker ps 检查此 VM 内的 运行 个容器:

$ docker ps  | grep kube-api
f53aebd26287        7e28efa976bd              "kube-apiserver --ad…"   16 minutes ago   k8s_kube-apiserver_kube-apiserver-minikube_kube-system_8009646ba816631d0677c2668886baad_1
12188a523d12        k8s.gcr.io/pause:3.2      "/pause"                 16 minutes ago   k8s_POD_kube-apiserver-minikube_kube-system_8009646ba816631d0677c2668886baad_1