10

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

$  minikube start --vm-driver=hyperkit

and it works well for me.

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

shows:

minikube: Running

cluster: Running

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

Is running minikube start twice not harmful?

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

$  kubectl version

shows:

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"}

Thanks for reading.

Rico
  • 58,485
  • 12
  • 111
  • 141
user674669
  • 10,681
  • 15
  • 72
  • 105
  • 2
    run eval $(minikube docker-env) and then docker ps . You will have your containers there. Check this link https://kubernetes.io/docs/setup/minikube/ – Shane Warne Oct 29 '18 at 19:44

3 Answers3

5

Each minikube cluster corresponds to a profile. You can run:

minikube profile list

to view all the profiles in local minikube. To delete a profile (cluster), you can run the following command:

minikube delete -p <profile-name>
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Riju Nayak
  • 59
  • 1
  • 1
4

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

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.

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
Rico
  • 58,485
  • 12
  • 111
  • 141
1

You can use minikube profile list to see your clusters started with minikube start:

$ minikube profile list
|-----------|-----------|---------|----------------|------|---------|---------|-------|--------|
|  Profile  | VM Driver | Runtime |       IP       | Port | Version | Status  | Nodes | Active |
|-----------|-----------|---------|----------------|------|---------|---------|-------|--------|
| minikube  | kvm2      | docker  | 192.168.39.145 | 8443 | v1.24.3 | Running |     1 | *      |
| minikube2 | kvm2      | docker  | 192.168.50.46  | 8443 | v1.24.3 | Running |     1 |        |
|-----------|-----------|---------|----------------|------|---------|---------|-------|--------|
admdrew
  • 3,790
  • 4
  • 27
  • 39