Aller au contenu

Minikube

minikube

Minikube is a single node Kubernetes Cluster used to learn and experiment K8s.

Installation of Minikube

In this documentation, we install a Minikube K8s Cluster on an OSX machine running VMWare Fusion 13.

What is Minikube ? Minikube runs a single-node Kubernetes cluster on your machine so that you can try out Kubernetes for your daily development work.

Step 1 - Initial check

To check if virtualization is supported on macOS, run the following command on your terminal.

sysctl -a | grep -E --color 'machdep.cpu.features|VMX'
If you see VMX in the output (should be colored), the VT-x feature is enabled in your machine.

Step 2 - Install kubectl

Make sure you have kubectl installed. You can install it using brew:

brew install kubectl

Homebrew is a free and open-source software package manager in mac that simplifies the installation of software.

Verify kubectl version:

kubectl version --short

Step 4 - Install a Hypervisor

If you do not already have one installed. It could be one of these:

  • HyperKit
  • VirtualBox
  • VMware Fusion (not supported on Mx)
  • Qemu

Step 5 - Install and start Minikube

The easiest way to install Minikube on macOS (M2) is using Homebrew, and specifying that we are using QEMU.

brew install qemu
brew install socket_vmnet
brew tap homebrew/services
HOMEBREW=$(which brew) && sudo ${HOMEBREW} services start socket_vmnet
brew install minikube
minikube start --driver qemu --network socket_vmnet

To install Minikube on macOS (Intel) is using Homebrew, and specifying that we are using VMWare.

brew install minikube
minikube version
minikube start --driver='vmware'

Once minikube started successfully , we can verify its status

minikube status
If your cluster is running, the output from minikube status should be similar to:
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

kubectl is automatically configured to use the new minikube cluster.

Step 7 - More commands

After you have confirmed whether Minikube is working with your chosen hypervisor, you can continue to use Minikube or you can stop your cluster. To stop your cluster, run:

minikube stop

To access the Minikube Dashboard:

minikube dashboard
To delete minikube:
minikube delete

Deletes a local Kubernetes cluster. This command deletes the VM, and removes all associated files.

Utilization

This section describe some of the main commands to use to manage a K8s Cluster, deploy containers, pods, etc.

TODO

References


Dernière mise à jour: 3 October 2023