Minikube helps to create the Kubernetes environment on a personal computer. This post aims to show you a few simple steps to install Minikube on Windows Machine. Before installing minikube, make sure you have installed kubectl.
Step 1: Install kubectl
Go to https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-windows and following the link under “Install Kubectl on Windows”.
Create a folder called Kube or anything and then copy and paste the minikube .exe file in that folder.
Next, click on “This PC” then properties and then advance and then click on environmental variables.
Next, click on path and then click on edit and add the path as shown below:
Step 2: Install Hypervisor
To run minikube you need a hypervisor. If you already have not installed a hypervisor, you can install one of the following.
- Hyper-V
- VirtualBox
remember that if Hyper-V is already running on your machine you won’t be able to install a virtual box. so, if you want to use
VirtualBox, make sure Hyper-V is disabled.
Step 3: Install Minikube
Go to https://kubernetes.io/docs/tasks/tools/install-minikube/#install-minikube and download the .exe file from the link below.
https://github.com/kubernetes/minikube/releases/latest/download/minikube-installer.exe
download minikube-windows-amd64.exe.
Next, copy and paste the minikube-windows-amd64.exe file to the directory where you stored the kuebctl. Next, rename the
minkube-installer.exe to minikube.exe.
To start Minikube, type “minikube start” in the command prompt.
Ref: https://kubernetes.io/docs/tasks/tools/install-minikube/#install-minikube
To enable the dashboard:
minikube dashboard
Once you type the dashboard command as showb above, you will get a minikube dashboard link to access it. The link
will look simial to the below link.
http://127.0.0.1:56708/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/
SSH to minikube
To ssh inside minikube:
minikube ssh
Location of minikube config.json file
C:\Users\username\.minikube\machines\minikube
cat ~/.minikube/machines/minikube/config.json
What to do if the Minikube installation fails?
If the minikube installation fails. Then you need to run:
minikube config set vm-driver virtualbox
minkube stop
minikube delete
minikube start
Next go to the Windows user home directory such as C:\Users\username and delete the .kube and .minikube directory and then run “minikube start”.
Set memory and cpus config
minikube config set memory 5000
minikube config set cpus 4
minikube config set disk-size 30000MB
If you want to keep the default config and specify the memory during start time only, run :
The VM configs can be overridden by passing flags like:
minikube start --memory 1024
To check the current config stat run:
minikube config view
How to SSH to Minikube
To ssh inside minikube, run the command below.
minikube ssh
To get inside the pod from the windows command prompt
kubectl exec -it app_name sh
wget http://localhost:80
To see the directory list inside the pod without getting inside it
kubeclt exec app_name ls
To stop minikube type:
c:\kube>minikube stop
How to SSH inside a Pod in minikube
Note the pod name and then type:
kubectl exec -it myjenkins bash
To install Jenkins using helm you can install the jenkins chart.
Note: before running the helm command, make sure you have alredy installed helm on your machine.
c:\kube>helm install -name myjenkins stable/jenkins
To inspect the jenkins config run
helm inspect values stable/jenkins
To uninstall the chart use:
helm uninstlal myjenkins
and then run “helm list” to check if the chart has been removed successfully