本文介绍了我如何查看在Mac上的Docker中运行的所有minikube集群的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用最新的Docker社区版本在Mac上运行Kubernetes集群.我通常这样做:

I run a Kubernetes cluster on my mac using the latest Docker community edition. I usually do:

$  minikube start --vm-driver=hyperkit

对我来说很好.

今天,我在脚本中多次运行了该命令.现在,我如何知道Mac上正在运行多少个minikube VM?如何删除除其中之一以外的所有内容?我可以看到所有正在运行的minikube虚拟机的列表吗?

Today, I ran that command multiple times in a script. Now, how do I know how many minikube VMs are running on a mac? How do I delete all but one of them? Can I see a list of all minikube vms running?

$ minikube status

显示:

minikube: Running

cluster: Running

kubectl: Correctly Configured: pointing to minikube-vm at 192.168.64.3

运行minikube两次启动是否有害?

Is running minikube start twice not harmful?

我正在Mac OS High Sierra上运行minikube版本:v0.30.0.

I am running minikube version: v0.30.0 on Mac OS High Sierra.

$  kubectl version

显示:

Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.0",
GitCommit:"0ed33881dc4355495f623c6f22e7dd0b7632b7c0", GitTreeState:"clean", BuildDate:"2018-09-28T15:20:58Z", GoVersion:"go1.11", Compiler:"gc", Platform:"darwin/amd64"}

感谢阅读.

推荐答案

您正在使用 Hyperkit 使用/usr/local/bin/hyperkit命令行的minikube驱动程序(实际上,它使用 xhyve 系统管理程序).很简单:

You are using the Hyperkit minikube driver that uses the /usr/local/bin/hyperkit command line (in reality it uses the xhyve Hypervisor). So a simple:

$ ps -Af | grep hyperkit
    0  9445     1   0  1:07PM ttys002    1:45.27 /usr/local/bin/hyperkit -A -u -F /Users/youruser/.minikube/machines/minikube/hyperkit.pid -c 2 -m 2048M -s 0:0,hostbridge -s 31,lpc -s 1:0,virtio-net -U 2caa5ca9-d55c-11e8-92a0-186590def269 -s 2:0,virtio-blk,/Users/youruser/.minikube/machines/minikube/minikube.rawdisk -s 3,ahci-cd,/Users/youruser/.minikube/machines/minikube/boot2docker.iso -s 4,virtio-rnd -l com1,autopty=/Users/youruser/.minikube/machines/minikube/tty,log=/Users/youruser/.minikube/machines/minikube/console-ring -f kexec,/Users/youruser/.minikube/machines/minikube/bzimage,/Users/youruser/.minikube/machines/minikube/initrd,earlyprintk=serial loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=minikube

会告诉您您正在运行多少个Hyperkit进程/VM. AFAIK, minikube仅支持一个,但是如果您有适用于Mac的Docker .

will tell you how many Hyperkit processes/VMs you are running. AFAIK, minikube only supports one, but you could have another one if you have Docker for Mac installed.

然后,如果您执行以下操作:如何访问虚拟机是由Docker的HyperKit创建的吗?.您可以连接到VM并查看其中正在运行什么:

Then if you follow this: How to access the VM created by docker's HyperKit?. You can connect to VM an see what's running inside:

$ sudo screen /Users/youruser/.minikube/machines/minikube/tty
Welcome to minikube
minikube login: root
                         _             _
            _         _ ( )           ( )
  ___ ___  (_)  ___  (_)| |/')  _   _ | |_      __
/' _ ` _ `\| |/' _ `\| || , <  ( ) ( )| '_`\  /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )(  ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)

# docker ps
...  <== shows a bunch of K8s containers

这篇关于我如何查看在Mac上的Docker中运行的所有minikube集群的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 22:00