Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

How to Install Minikube on Ubuntu - Step by Step

This is a step by step guide to install Minikube on the Ubuntu Linux system. Minikube is a lightweight Kubernetes implementation that creates a VM on your local machine and deploys a simple cluster containing only one node. Minikube is available for Linux, macOS, and Windows systems. Minikube is very good option for testing kubernetes (k8s) if you don't have much compute resources in your system plus it doesn't require much configuration and it is ready to use application

I have installed Ubuntu on the VMware ESXi server as Virtual Machine in my lab. Edit settings of VM, and in the Virtual Hardware tab, expand CPU and enable checkbox of Hardware virtualization >> Expose hardware assisted virtualization to the guest OS.

Vmware vsphere esxi vcenter virtual machine edit settings virtual hardware vm options cpu hardware virtualization expose intel vt amd v kubernetes minikube linux windows.jpg

Once VM is ready with OS and configuration, Get sudo prompt on the system, Upgrade Ubuntu system with command apt-get update and apt-get upgrade. Install curl, apt-transport-https and vim packages application using apt command.

ubuntu@AnsibleAWX:~$ sudo su -
root@AnsibleAWX:~#
root@AnsibleAWX:~# apt-get update && apt-get upgrade -y
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Fetched 114 kB in 1s (109 kB/s)
Reading package lists... Done
root@AnsibleAWX:~#
root@AnsibleAWX:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  fwupd gir1.2-javascriptcoregtk-4.0 gir1.2-webkit2-4.0 gnome-shell-extension-desktop-icons gvfs gvfs-backends gvfs-bin gvfs-common gvfs-daemons gvfs-fuse gvfs-libs
  libegl-mesa0 libfwupd2 libfwupdplugin1 libgbm1 libgl1-mesa-dri libglapi-mesa libglx-mesa0 libjavascriptcoregtk-4.0-18 libsmbclient libwbclient0 libwebkit2gtk-4.0-37
  libxatracker2 linux-generic-hwe-20.04 linux-headers-generic-hwe-20.04 linux-image-generic-hwe-20.04 mesa-vulkan-drivers samba-libs ubuntu-advantage-tools
0 upgraded, 0 newly installed, 0 to remove and 29 not upgraded.
root@AnsibleAWX:~#
root@AnsibleAWX:~# apt-get install curl apt-transport-https vim -yA
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  apt-transport-https curl
0 upgraded, 2 newly installed, 0 to remove and 29 not upgraded.
Need to get 163 kB of archives.
After this operation, 574 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu focal-updates/universe amd64 apt-transport-https all 2.0.9 [1,704 B]
Get:2 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 curl amd64 7.68.0-1ubuntu2.14 [161 kB]
Fetched 163 kB in 0s (785 kB/s)
Selecting previously unselected package apt-transport-https.
(Reading database ... 184086 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_2.0.9_all.deb ...
Unpacking apt-transport-https (2.0.9) ...
Selecting previously unselected package curl.
Preparing to unpack .../curl_7.68.0-1ubuntu2.14_amd64.deb ...
Unpacking curl (7.68.0-1ubuntu2.14) ...
Setting up apt-transport-https (2.0.9) ...
Setting up curl (7.68.0-1ubuntu2.14) ...
Processing triggers for man-db (2.9.1-1) ...
root@AnsibleAWX:~#

Next install virtualbox application with its extension pack. Minikube will host the kubernetes node on this nested virtual box. Press Y to proceed. (Alternatively you can install kvm to host minikube)

Microsoft windows ansible awx minkube k8s k3s powershelll apt-get install virtuabox extenstion pack kubernetes docker container ansible tower.jpg

root@AnsibleAWX:~# apt-get install virtualbox virtualbox-ext-pack -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu build-essential dctrl-tools dkms dpkg-dev fakeroot g++ g++-9 gcc gcc-9 libalgorithm-diff-perl
  libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5 libatomic1 libbinutils libc-dev-bin libc6-dev libcrypt-dev libctf-nobfd0 libctf0 libdouble-conversion3
  libfakeroot libgcc-9-dev libgsoap-2.8.91 libitm1 liblsan0 liblzf1 libpcre2-16-0 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5opengl5 libqt5printsupport5
  libqt5svg5 libqt5widgets5 libqt5x11extras5 libquadmath0 libsdl1.2debian libstdc++-9-dev libtsan0 libubsan1 libvncserver1 libxcb-xinerama0 libxcb-xinput0 linux-libc-dev
  make manpages-dev qt5-gtk-platformtheme qttranslations5-l10n virtualbox-dkms virtualbox-qt
Suggested packages:
  binutils-doc debtags menu debian-keyring g++-multilib g++-9-multilib gcc-9-doc gcc-multilib autoconf automake libtool flex bison gcc-doc gcc-9-multilib gcc-9-locales
  glibc-doc qt5-image-formats-plugins qtwayland5 libstdc++-9-doc make-doc vde2 virtualbox-guest-additions-iso
The following NEW packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu build-essential dctrl-tools dkms dpkg-dev fakeroot g++ g++-9 gcc gcc-9 libalgorithm-diff-perl
  libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5 libatomic1 libbinutils libc-dev-bin libc6-dev libcrypt-dev libctf-nobfd0 libctf0 libdouble-conversion3
  libfakeroot libgcc-9-dev libgsoap-2.8.91 libitm1 liblsan0 liblzf1 libpcre2-16-0 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5opengl5 libqt5printsupport5
  libqt5svg5 libqt5widgets5 libqt5x11extras5 libquadmath0 libsdl1.2debian libstdc++-9-dev libtsan0 libubsan1 libvncserver1 libxcb-xinerama0 libxcb-xinput0 linux-libc-dev
  make manpages-dev qt5-gtk-platformtheme qttranslations5-l10n virtualbox virtualbox-dkms virtualbox-ext-pack virtualbox-qt
0 upgraded, 57 newly installed, 0 to remove and 29 not upgraded.
Need to get 92.1 MB of archives.
After this operation, 397 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y

Configure package virtualbox-ext-pack, accept EULA, press Ok using tab and enter key.

Linux ubuntu minikube configuring virtualbox-ext-pack k8s kubernetes virtualization containrization nested k3s light docker ansible-awx setup deployment.jpg

Accept the terms of the VIrtualBox PUEL license pressing YES option.

Virtualbox virtual box on ubuntu linux redhat ext-pack kubenretes k3s k38 vmware vsphere virtualization amd vt intelv container docker rkt cri-o kvm ansible awx minikube.jpg

Package installation is completed. Download Minikube application. (you can use wget application to download this application and rename it). Change execution mode of Minikube application file. copy it to /usr/local/bin folder. Its time to check minikube now, check its version.

Windows Microsoft curl minikube linux ubuntu amd64 googleapis storage release latest chmod 755 usr local bin version kubectl kubernetes version application ansible awx tower.jpg

root@AnsibleAWX:~# curl -o minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 73.1M  100 73.1M    0     0  76.5M      0 --:--:-- --:--:-- --:--:-- 76.5M
root@AnsibleAWX:~#
root@AnsibleAWX:~# ls -l
total 74952
-rw-r--r-- 1 root root 76750347 Dec  1 13:43 minikube
root@AnsibleAWX:~#
root@AnsibleAWX:~# chmod 755 minikube
root@AnsibleAWX:~#
root@AnsibleAWX:~# ls -l
total 74952
-rwxr-xr-x 1 root root 76750347 Dec  1 13:43 minikube
root@AnsibleAWX:~#
root@AnsibleAWX:~# cp minikube /usr/local/bin/
root@AnsibleAWX:~#
root@AnsibleAWX:~# minikube version
minikube version: v1.28.0
commit: 986b1ebd987211ed16f8cc10aed7d2c42fc8392f
root@AnsibleAWX:~#

Start the minikube as shown below, and verify the nodes using kubectl command. There is only one node in my k8s cluster. It holds all master and workers roles features and control-plane.

minikube start cpu memory addon ingress kubectl get nodes ansible awx powershell kubernetes kubectl k3s k3d powershell esxi ansible awx tower controller.jpg

ubuntu@AnsibleAWX:~$
ubuntu@AnsibleAWX:~$ minikube start --cpus=4 --memory=6g --addons=ingress
* minikube v1.28.0 on Ubuntu 20.04
* Using the virtualbox driver based on existing profile
* Starting control plane node minikube in cluster minikube
* Creating virtualbox VM (CPUs=4, Memory=6144MB, Disk=20000MB) ...
* Preparing Kubernetes v1.25.3 on Docker 20.10.20 ...
  - Generating certificates and keys ...
  - Booting up control plane ...
  - Configuring RBAC rules ...
* Verifying Kubernetes components...
  - Using image k8s.gcr.io/ingress-nginx/controller:v1.2.1
  - Using image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1
  - Using image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1
  - Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Verifying ingress addon...
* Enabled addons: storage-provisioner, default-storageclass, ingress
* kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
ubuntu@AnsibleAWX:~$
ubuntu@AnsibleAWX:~$ minikube kubectl get nodes
    > kubectl.sha256:  64 B / 64 B [-------------------------] 100.00% ? p/s 0s
    > kubectl:  42.93 MiB / 42.93 MiB [----------] 100.00% 125.13 MiB p/s 500ms
NAME       STATUS   ROLES           AGE    VERSION
minikube   Ready    control-plane   102s   v1.25.3

Next I have assigned kubectl alias, verify the all pods in cluster. At this point Minikube is ready to rock n` roll.

minikube alias kubectl minikube kubernetes get pods deployment ingress controller api etcd proxy schenduler stroage provisioner nginx ingress admission controller load balancer metalb bare metal ansible redhat linux.jpg

ubuntu@AnsibleAWX:~$ alias kubectl="minikube kubectl --"
ubuntu@AnsibleAWX:~$
ubuntu@AnsibleAWX:~$ kubectl get pods -A
NAMESPACE       NAME                                        READY   STATUS      RESTARTS       AGE
ingress-nginx   ingress-nginx-admission-create-7dzbt        0/1     Completed   0              3m43s
ingress-nginx   ingress-nginx-admission-patch-69hct         0/1     Completed   1              3m43s
ingress-nginx   ingress-nginx-controller-5959f988fd-7vlh5   1/1     Running     0              3m43s
kube-system     coredns-565d847f94-9ndht                    1/1     Running     0              3m43s
kube-system     etcd-minikube                               1/1     Running     0              3m56s
kube-system     kube-apiserver-minikube                     1/1     Running     0              3m53s
kube-system     kube-controller-manager-minikube            1/1     Running     0              3m53s
kube-system     kube-proxy-jlvl5                            1/1     Running     0              3m43s
kube-system     kube-scheduler-minikube                     1/1     Running     0              3m59s
kube-system     storage-provisioner                         1/1     Running     1 (3m8s ago)   3m49s
ubuntu@AnsibleAWX:~$

Useful Articles
Configure Nginx Load Balancer for the Kubernetes API Server - Part 1
Install and configure Kubernetes cluster master nodes using kubeadm - Part 2
Install and configure Kubernetes cluster worker nodes using kubeadm - Part 3
Kubernetes kubeadm join couldn't validate the identity of the API server connection refused
Kubernetes kubeadm join could not find a jws signature in the cluster-info ConfigMap for token ID
Setup and deploy Ingress controller for Kubernetes on Bare Metal servers
Setup HAProxy for Ingress Controller Kubernetes Cluster

Go Back

Comment

Blog Search

Page Views

8961173

Follow me on Blogarama