Reading Time: 5 minutes

What Is Minikube?

Minikube is the name of a software program written in Go, which can build a local Kubernetes cluster on a single host. It uses a meager amount of resources to run a mini Kubernetes deployment. Minikube is mainly used for testing purposes using different scenarios or versions of Kubernetes

This is accomplished within a local environment, so a developer or administrator can review and adjust the needed variables. Since Minikube runs an instance of virtual box, installs Docker, and deploys the essential Kubernetes containers within that limited virtual space, it is not recommended for a production environment.

Linux CentOS installation

First, we need to check if our Linux system supports virtualization with the following command and verify that the output is non-empty and mentions "VMX"

root@host [~]# grep -E --color 'vmx|svm' /proc/cpuinfo
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave osxsave avx f16c rdrand
root@host [~]# 

Prerequisites

  • This task should be initiated on a dedicated server as opposed to a VPS since a VPS is considered a virtualized service and will not support virtualization within that environment.
  • Make sure we have kubectl installed before we start a Minikube installation.
  • If we do not already have a hypervisor installed, install one of these now.
  • The Minikube option --vm-driver=none operates the Kubernetes components on a host and not within a VM. When using this driver, it will require both Docker and a Linux environment, but not a hypervisor.
  • If we are using the none driver in Ubuntu/Debian, we should utilize the .deb package for Docker rather than the snap package, which does not work with Minikube.
  • Before using the --vm-driver=none option, please consult the Minikube installation documentation for more information.
  • Warning: Using the “none” VM driver may result in security problems and data loss issues.

Installing Minikube

There are several test packages for Minikube available. We can use the Linux (AMD64) packages from the Minikube’s releases pages noted on GitHub. In this instance, we will use the CentOS 7 Linux distribution package manager to install a proper version.

Install Minikube via Direct Download

First, we will download the appropriate package and then run this command.

root@host [~]# curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl

Next, we will add the Minikube executable to our path using this command.

root@host [~]# mkdir -p /usr/local/bin/
root@host [~]# install minikube /usr/local/bin/

Installation on MacOS

First, we need to verify if virtualization is supported on our macOS. Run the following command in the terminal to check.

root@host [~]# sysctl -a | grep -E --color 'machdep.cpu.features|VMX'

If we see “VMX” in the output, the VT-x feature will be enabled in our machine.

Prerequisites

If we do not have a hypervisor installed, we can use one of the following options.

Install Minikube

The quickest way to install Minikube on a macOS is by using Homebrew.

root@host [~]# brew install minikube

It can also be installed on our macOS by downloading the stand-alone binary.

root@host [~]# curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 && chmod +x minikube

Next, we should add the Minikube executable to our path.

root@host [~]# mv minikube /usr/local/bin

Windows installation

To verify if virtualization is installed on Windows 8and above, run the following command in our Windows terminal or via command prompt.

PS C:Usersuser> systeminfo

Host Name:                 MEROVINGIAN
OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.17134 N/A Build 17134
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          user
Registered Organization:
Product ID:                00329-00000-00003-AA599
Original Install Date:     7/6/2019, 7:12:24 AM
System Boot Time:          4/28/2020, 10:12:17 PM
System Manufacturer:       LENOVO
System Model:              20LB0026US
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 142 Stepping 10 GenuineIntel ~1792 Mhz
BIOS Version:              LENOVO N27ET32W (1.18 ), 11/8/2018
Windows Directory:         C:Windows
System Directory:          C:Windowssystem32
Boot Device:               DeviceHarddiskVolume2
System Locale:             en-us;English (United States)
Input Locale:              en-us;English (United States)
Time Zone:                 (UTC-05:00) Eastern Time (US & Canada)
Total Physical Memory:     16,206 MB
Available Physical Memory: 9,109 MB
Virtual Memory: Max Size:  18,638 MB
Virtual Memory: Available: 8,908 MB
Virtual Memory: In Use:    9,730 MB
Page File Location(s):     C:pagefile.sys
Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                           Virtualization Enabled In Firmware: Yes
                           Second Level Address Translation: Yes
                           Data Execution Prevention Available: Yes

If we can see the following output, virtualization will be supported on Windows.

  • Hyper-V Requirements: VM Monitor Mode Extensions: Yes
  • Virtualization Enabled In Firmware: Yes
  • Second Level Address Translation: Yes
  • Data Execution Prevention Available: Yes

Note: To enable Hyper-V on Windows 10, run the following command in the terminal or powershell (as administrator)

PS C:Windowssystem32>Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

 Enable-WindowsOptionalFeature: Microsoft-Hyper-V
    Running
    [ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo           ]
Do you want to restart the computer to complete this operation now?
[Y] Yes  [N] No  [?] Help (default is "Y"): Y
Path          :
Online        : True
RestartNeeded : False

PS C:Windowssystem32>

Prerequisites

First, we should check to see if we have a hypervisor installed. If not, we can install one of these options.

  • Hyper-V
  • VirtualBox

Note: Hyper-V can run on these versions of Windows 10:

  • Windows 10 Enterprise
  • Windows 10 Professional
  • Windows 10 Education
Note:
The Hyper-V role cannot be installed on Windows 10 Home.

Install Minikube using Chocolatey

The simplest method for the installation of Minikube on Windows is by using the Chocolatey install software. (Note: we should run this command as an administrator)

choco install minikube
PS C:Windowssystem32> choco install minikube
Chocolatey v0.10.15
2 validations performed. 1 success(es), 1 warning(s), and 0 error(s).

Installing the following packages:
minikube
By installing you accept licenses for the packages.
Progress: Downloading kubernetes-cli 1.18.2... 100%
Progress: Downloading Minikube 1.10.1... 100%

kubernetes-cli v1.18.2 [Approved]
kubernetes-cli package files install completed. Performing other installation steps.
The package kubernetes-cli wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint):Y

Extracting 64-bit C:ProgramDatachocolateylibkubernetes-clitoolskubernetes-client-windows-amd64.tar.gz to C:ProgramDatachocolateylibkubernetes-clitools...
C:ProgramDatachocolateylibkubernetes-clitools
Extracting 64-bit C:ProgramDatachocolateylibkubernetes-clitoolskubernetes-client-windows-amd64.tar to C:ProgramDatachocolateylibkubernetes-clitools...
C:ProgramDatachocolateylibkubernetes-clitools
 ShimGen has successfully created a shim for kubectl.exe
 The install of kubernetes-cli was successful.
  Software installed to 'C:ProgramDatachocolateylibkubernetes-clitools'

Minikube v1.10.1 [Approved]
minikube package files install completed. Performing other installation steps.
 ShimGen has successfully created a shim for minikube.exe
 The install of minikube was successful.
  Software install location not explicitly set, could be in package or
  default install location if installer.

Chocolatey installed 2/2 packages.
 See the log for details (C:ProgramDatachocolateylogschocolatey.log).
PS C:Windowssystem32>

Once the Minikube installation completes, restart the CLI session. Once this finishes, Minikube will automatically be added to our path.

Confirm Installation & Start Cluster

To confirm successful installation of both a hypervisor and Minikube, we can run the following command to start up a local Kubernetes cluster:

PS C:Windowssystem32> minikube start: --vm-driver=<driver_name>

Note: When setting the --vm-driver with the minikube start command, enter the name of the hypervisor installed in lowercase letters where <driver_name> is mentioned above. A full list of --vm-driver values is available in specifying the VM driver documentation.

Cluster Status

Once the minikube start command completes, run the command below to check the status of the cluster.

PS C:Windowssystem32> minikube status

If our cluster is running, the output from minikube status should be similar to:

host: Running
 kubelet: Running
 apiserver: Running
 kubeconfig: Configured
After confirming Minikube

Once we verify that minikube is working with our selected hypervisor, we can begin using Minikube, or we can stop our cluster. To stop the cluster, run this command.

PS C:Windowssystem32> minikube stop

Clean up Local State

Next, if we installed Minikube, and run the minikube start command and it returned the error:

machine does not exist

we need to clear to minikube’s local state using this command.

PS C:Windowssystem32> minikube delete

Conclusion

Minikube is a useful tool for test multiple cluster options within a closed environment. It can also be used as a precursor to establish working parameters for a new Kubernetes cluster. The amount of options available for testing can be numerous which provides for a wide range of available situations.

Give us a call at 800.580.4985, or open a chat or ticket with us to speak with one of our knowledgeable Solutions or Experienced Hosting advisors to learn how you can take advantage of these techniques today!

Avatar for Beau Kent

About the Author: Beau Kent

Latest Articles

In-place CentOS 7 upgrades

Read Article

How to use kill commands in Linux

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change the root password in WebHost Manager (WHM)

Read Article