Minikube#
Minikube is a test implementation of the k8s that runs in on a specified container runtime.
To check the installation and version of your minikube by:
minikube version
minikube version: v1.37.0
commit: 65318f4cfff9c12cc87ec9eb8f4cdd57b25047f3
Lifecycle#
The lifecycle of the minicube cluster primarly managed by the commands:
minikube startto start the cluster.minikube statusto check the curresnt status of the cluster.minikube stopto terminate the cluster.minikube deleteto remove the cluster from user container runtime.
The following example illustrates a typical behaviour for different minikube commands.
Start the cluster with the command:
minikube start &> /dev/null
Once you’ve completed the previous command, you’ll have a corresponding container called minikube in your docker. The following cell shows it.
docker ps | grep --color=never minikube
ab97db60e806 gcr.io/k8s-minikube/kicbase:v0.0.48 "/usr/local/bin/entr…" About a minute ago Up About a minute 127.0.0.1:32768->22/tcp, 127.0.0.1:32769->2376/tcp, 127.0.0.1:32770->5000/tcp, 127.0.0.1:32771->8443/tcp, 127.0.0.1:32772->32443/tcp minikube
To make sure everything is OK, try checking the minikube status.
minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
With minikube stop you’re able to stop the minikube container but not delete it.
minikube stop
✋ Stopping node "minikube" ...
🛑 Powering off "minikube" via SSH ...
🛑 1 node stopped.
Now minikube have the corresponding status.
minikube status
true
minikube
type: Control Plane
host: Stopped
kubelet: Stopped
apiserver: Stopped
kubeconfig: Stopped
And the container is stopped in the docker.
docker ps -a | grep --color=never minikube
ab97db60e806 gcr.io/k8s-minikube/kicbase:v0.0.48 "/usr/local/bin/entr…" About a minute ago Exited (130) 6 seconds ago minikube
You can stop the minikube cluster by running the command minicube delete.
minikube delete
🔥 Deleting "minikube" in docker ...
🔥 Deleting container "minikube" ...
🔥 Removing /home/fedor/.minikube/machines/minikube ...
💀 Removed all traces of the "minikube" cluster.
So minikube status retunrs the corresponding output.
minikube status
true
🤷 Profile "minikube" not found. Run "minikube profile list" to view all profiles.
👉 To start a cluster, run: "minikube start"
Profiles#
You can manage several minikube clusters, but in different profiles. To do so, use the --profile <profile name> option with for minikube lifecycle commands.
To manage the profiles there are following commands:
minikube profile list: lists the created minikube profiles.minikube profile <profile name>: sets the profile<profile name>as default profile.
This cell runs two minikube clusters with different profiles.
minikube start &> /dev/null
minikube start --profile second &> /dev/null
The output of the minikube profile list is represented by the following code.
minikube profile list
┌──────────┬────────┬─────────┬──────────────┬─────────┬────────┬───────┬────────────────┬────────────────────┐
│ PROFILE │ DRIVER │ RUNTIME │ IP │ VERSION │ STATUS │ NODES │ ACTIVE PROFILE │ ACTIVE KUBECONTEXT │
├──────────┼────────┼─────────┼──────────────┼─────────┼────────┼───────┼────────────────┼────────────────────┤
│ minikube │ docker │ docker │ 192.168.49.2 │ v1.34.0 │ OK │ 1 │ * │ │
│ second │ docker │ docker │ 192.168.58.2 │ v1.34.0 │ OK │ 1 │ │ * │
└──────────┴────────┴─────────┴──────────────┴─────────┴────────┴───────┴────────────────┴────────────────────┘
The ACTIVE PROFILE column marks the default prifle. The following cell changes the active profile and an updated profiles list:
minikube profile second
minikube profile list
✅ minikube profile was successfully set to second
┌──────────┬────────┬─────────┬──────────────┬─────────┬────────┬───────┬────────────────┬────────────────────┐
│ PROFILE │ DRIVER │ RUNTIME │ IP │ VERSION │ STATUS │ NODES │ ACTIVE PROFILE │ ACTIVE KUBECONTEXT │
├──────────┼────────┼─────────┼──────────────┼─────────┼────────┼───────┼────────────────┼────────────────────┤
│ minikube │ docker │ docker │ 192.168.49.2 │ v1.34.0 │ OK │ 1 │ │ │
│ second │ docker │ docker │ 192.168.58.2 │ v1.34.0 │ OK │ 1 │ * │ * │
└──────────┴────────┴─────────┴──────────────┴─────────┴────────┴───────┴────────────────┴────────────────────┘
Remove the corresponding clusters.
minikube delete --profile second
minikube delete
🔥 Deleting "second" in docker ...
🔥 Deleting container "second" ...
🔥 Removing /home/fedor/.minikube/machines/second ...
💀 Removed all traces of the "second" cluster.
🔥 Deleting "minikube" in docker ...
🔥 Deleting container "minikube" ...
🔥 Removing /home/fedor/.minikube/machines/minikube ...
💀 Removed all traces of the "minikube" cluster.
Nodes#
The --nodes argument in the minikube start controls how many nodes are stared in the cluster.
The following cell starts the cluster with two nodes.
minikube start --nodes=2 &> /dev/null
There are corresponding containers in Docker.
docker ps | grep --color=never minikube
93ae9f50286f gcr.io/k8s-minikube/kicbase:v0.0.48 "/usr/local/bin/entr…" 15 seconds ago Up 15 seconds 127.0.0.1:32783->22/tcp, 127.0.0.1:32784->2376/tcp, 127.0.0.1:32785->5000/tcp, 127.0.0.1:32786->8443/tcp, 127.0.0.1:32787->32443/tcp minikube-m02
49771a3d2887 gcr.io/k8s-minikube/kicbase:v0.0.48 "/usr/local/bin/entr…" 38 seconds ago Up 37 seconds 127.0.0.1:32778->22/tcp, 127.0.0.1:32779->2376/tcp, 127.0.0.1:32780->5000/tcp, 127.0.0.1:32781->8443/tcp, 127.0.0.1:32782->32443/tcp minikube
To list the nodes using minikube interface use:
minikube node list
minikube 192.168.49.2
minikube-m02 192.168.49.3
minikube delete
✋ Stopping node "minikube-m02" ...
🛑 Powering off "minikube-m02" via SSH ...
✋ Stopping node "minikube" ...
🛑 Powering off "minikube" via SSH ...
🛑 2 nodes stopped.
Addons#
The add-ons are managed in minikube by the addons commands group:
The
minikube addons listto list available addons.The
minikube addons enable <name>to enable add-on.
The following cell lists available add-ons.
minikube addons list
┌─────────────────────────────┬──────────┬────────────┬────────────────────────────────────────┐
│ ADDON NAME │ PROFILE │ STATUS │ MAINTAINER │
├─────────────────────────────┼──────────┼────────────┼────────────────────────────────────────┤
│ ambassador │ minikube │ disabled │ 3rd party (Ambassador) │
│ amd-gpu-device-plugin │ minikube │ disabled │ 3rd party (AMD) │
│ auto-pause │ minikube │ disabled │ minikube │
│ cloud-spanner │ minikube │ disabled │ Google │
│ csi-hostpath-driver │ minikube │ disabled │ Kubernetes │
│ dashboard │ minikube │ enabled ✅ │ Kubernetes │
│ default-storageclass │ minikube │ enabled ✅ │ Kubernetes │
│ efk │ minikube │ disabled │ 3rd party (Elastic) │
│ freshpod │ minikube │ disabled │ Google │
│ gcp-auth │ minikube │ disabled │ Google │
│ gvisor │ minikube │ disabled │ minikube │
│ headlamp │ minikube │ disabled │ 3rd party (kinvolk.io) │
│ inaccel │ minikube │ disabled │ 3rd party (InAccel [info@inaccel.com]) │
│ ingress │ minikube │ disabled │ Kubernetes │
│ ingress-dns │ minikube │ disabled │ minikube │
│ inspektor-gadget │ minikube │ disabled │ 3rd party (inspektor-gadget.io) │
│ istio │ minikube │ disabled │ 3rd party (Istio) │
│ istio-provisioner │ minikube │ disabled │ 3rd party (Istio) │
│ kong │ minikube │ disabled │ 3rd party (Kong HQ) │
│ kubeflow │ minikube │ disabled │ 3rd party │
│ kubetail │ minikube │ disabled │ 3rd party (kubetail.com) │
│ kubevirt │ minikube │ disabled │ 3rd party (KubeVirt) │
│ logviewer │ minikube │ disabled │ 3rd party (unknown) │
│ metallb │ minikube │ disabled │ 3rd party (MetalLB) │
│ metrics-server │ minikube │ disabled │ Kubernetes │
│ nvidia-device-plugin │ minikube │ disabled │ 3rd party (NVIDIA) │
│ nvidia-driver-installer │ minikube │ disabled │ 3rd party (NVIDIA) │
│ nvidia-gpu-device-plugin │ minikube │ disabled │ 3rd party (NVIDIA) │
│ olm │ minikube │ disabled │ 3rd party (Operator Framework) │
│ pod-security-policy │ minikube │ disabled │ 3rd party (unknown) │
│ portainer │ minikube │ disabled │ 3rd party (Portainer.io) │
│ registry │ minikube │ disabled │ minikube │
│ registry-aliases │ minikube │ disabled │ 3rd party (unknown) │
│ registry-creds │ minikube │ disabled │ 3rd party (UPMC Enterprises) │
│ storage-provisioner │ minikube │ enabled ✅ │ minikube │
│ storage-provisioner-gluster │ minikube │ disabled │ 3rd party (Gluster) │
│ storage-provisioner-rancher │ minikube │ disabled │ 3rd party (Rancher) │
│ volcano │ minikube │ disabled │ third-party (volcano) │
│ volumesnapshots │ minikube │ disabled │ Kubernetes │
│ yakd │ minikube │ disabled │ 3rd party (marcnuri.com) │
└─────────────────────────────┴──────────┴────────────┴────────────────────────────────────────┘