Minimum requirements to run Minikube locally:
- Machine Type – minimum 4 vCPUs.
- RAM – minimum 4 GB.
- VT-x/AMD-v virtualization must be enabled in your system BIOS
If using macOS:
- xhyve driver,
- VirtualBox, or VMware Fusion.
If using Linux:
- VirtualBox or KVM.
NOTE: Minikube supports the --vm-driver=none
option that runs Kubernetes components on the host and not in a VM. Docker is required to use this driver, but not the hypervisor.
If using Windows:
- VirtualBox or Hyper-V. VMware Workstation is not supported.
Since VirtualBox is available on all three platforms, we will describe this option.
We will not cover the details of VirtualBox installation since it is very common and instructions are widely available online.
-
Go to the Virtualbox website.
-
Download and install the binaries required for your operating system.
-
Make sure that you install VirtualBox 5.2.0 Oracle VM VirtualBox Extension Pack as well.
At the time i wrote this article, the most current version was VirtualBox-5.2.0-118431.
Once VirtualBox is installed, you will see a screen similar to the following:
-
Create a new VM with 4 vCPUs, 4Gb memory, and 10GB disk space.
-
Download your preferred version of Ubuntu. I will be using Ubuntu 16.04.3 LTS.
-
Under VM Settings/Storage, mount your ISO image and power on the VM.
-
Install Ubuntu with default options. I used
openebs/password
asusername/password
for simplicity. If you use something else make sure to replace it with yours when you follow the instructions. -
Finally login to your Ubuntu VM.
-
On your Ubuntu host, install the SSH server:
sudo apt-get install openssh-server
-
Now you should be able to access your VM using SSH. Check the status by running:
sudo service ssh status
-
Disable firewall on your Ubuntu VM by running:
sudo ufw disable
-
Install curl if it’s not already installed:
sudo apt install curl
-
By default, for each virtual machine, VirtualBox creates a private network (10.0.2.x) which is connected to your laptop’s network using NAT. However, you may not be able to your VMs from your local host through SSH just yet. To access your VM, you need to configure port forwarding. In the network setting of the VM. Click on Advanced/Port Forwarding and create a rule with the Host port 3022 and Guest Port 22. Name it SSH and leave other fields blank.
-
Now you can connect to your Ubuntu VM from your laptop using SSH with localhost as the address and port 3022 instead of 22. Connect to your Ubuntu VM using the following credentials:
openebs/password
To get the latest version of Docker, install it from the official Docker repository.
-
On your Ubuntu VM, run the following commands:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update
-
Confirm that you want to install the binaries from the Docker repository instead of the default Ubuntu repository by running:
sudo apt-get install -y docker-ce
-
Install Docker and make sure it’s up and running after installation is complete:
sudo systemctl status docker
OpenEBS uses iSCSI to connect to the block volumes. Therefore, you need to install the open-iscsi package on your Ubuntu machine.
-
On your Ubuntu host, run:
sudo apt-get update sudo apt-get install open-iscsi sudo service open-iscsi restart
-
Check that the iSCSI initiator name is configured:
sudo cat /etc/iscsi/initiatorname.iscsi
-
Verify the iSCSI service is up and running:
sudo service open-iscsi status
-
On your Ubuntu host, install minikube by running:
chmod +x minikube sudo mv minikube /usr/local/bin/
-
Install kubectl:
chmod +x kubectl sudo mv kubectl /usr/local/bin/
-
Set up directories for storing minkube and kubectl configurations:
mkdir $HOME/.kube || true touch $HOME/.kube/config
-
Set up an environment for minikube by adding the following lines to the end of the ~/.profile file:
export MINIKUBE_WANTREPORTERRORPROMPT=false export MINIKUBE_HOME=$HOME export CHANGE_MINIKUBE_NONE_USER=true export KUBECONFIG=$HOME/.kube/config
-
Confirm that environment variables are saved in your profile file:
cat ~/.profile
-
Start minikube:
sudo -E minikube start --vm-driver=none
-
If you forgot to install Docker, you will get an error. When using the none driver, the kubectl config and credentials generated will be root-owned and will appear in the root home directory. To fix this, set the correct permissions:
sudo chgrp -R $USER $HOME/.kube sudo chown -R $USER $HOME/.minikube sudo chgrp -R $USER $HOME/.minikube
-
Verify that minikube is configured correctly and it has started by running:
minikube status
-
Verify Kubernetes configuration Check that kubectl is configured and services are up and running by getting the list of Kubernetes nodes and pods:
kubectl get nodes kubectl get pods --all-namespaces
From your command line, run:
git clone https://github.com/openebs/workshop
cd openebs/workshop
This is the working directory for the workshop. You use the example .yaml
files that are located in the workshop/plans directory in the following exercises.