How To Install Kubernetes With Minikube On Ubuntu 18.04 LTS

This comprehensive Linux guide expects that you run the following commands as root user but if you decide to run the commands as a different user then ensure that the user has sudo access and that you precede each of the privileged commands with sudo

Minikube is used to run Kubernates locally. It runs Kubernates in a virtual machine on your machine. Setting up a Kubernetes cluster from scratch can be quite the hurdle and would definitely stop many people from learning Kubernetes before ever getting to know the tool itself. This is the problem that Minikube solves.

Installing Dependencies

To install minikube, we first need to ensure that a hypervisor is already installed on the system such as KVM or VirtualBox. Secondly kubectl must be installed.

Installing Kubectl

Step One: Run the following command in terminal to download the latest release using curl

root@codesposts:~# curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
%Total %Received %Xferd Average Speed Time Time Time Current
                        Dload  Upload TotalSpentLeft  Speed
100 40.9M 100 40.9M 0 0  129M      0 --:--:-- --:--:-- 129M

Step Two: Make the kubectl binary executable.

chmod +x ./kubectl

Step Three: Add the binary to the PATH

mv ./kubectl /usr/local/bin/kubectl

Step Four : Test to ensure the version you installed is up-to-date:

root@codesposts:~# kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}

Installing Hypervisor

If you do not already have a hypervisor installed, install one of these now: KVM or VirtualBox.

Installing VirtualBox

apt-get install virtualbox virtualbox-ext-pack

Installing KVM

apt-get install qemu-kvm libvirt-bin virtinst bridge-utils cpu-checker

Installing Minikube

There are two ways to install Minikube.

Install Using Package

You can find Latest and experimental releases of Linux packages from Minikube’s releases page on GitHub.
Use your Linux’s distribution’s package tool to install a suitable package

Install Using Direct Download

Open terminal and type the following command to download Minikube using curl

root@codesposts:~# curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
% Total %Received %Xferd Average Speed Time Time Time Current Speed
100 39.8M  100 39.8M    0     0  75.2M      0 --:--:-- --:--- 75.0M

Make the binary executable

chmod +x minikube

Add Minikube to PATH

install minikube /usr/local/bin

If Minuke has been succesfully installed, run the following command:

minikube start

You need to clear minikube’s local state if you get the error : machine does not exist

minikube delete

Installing Kubernates

Step One: Install Minikube and create a cluster

minikube start

Check the cluster info using

kubectl cluster-info

You can also check the Kubectl default configuration with the following command:

kubectl config view

To check the running nodes, run the following command:

kubectl get nodes

You can also access the Minikube Virtualbox with the following command:

minikube ssh

You can check the status of Minikube with the following command:

minikube status

Accessing Kubernates Dashboard

Run the following command to get to the minikube dashboard.

minikube dashboard --url

The Minikube web url is now generated. Next, open any web browser and type the URL http://127.0.0.1:56508/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/.

You will be redirected to the Kubernate dashboad

The post How To Install Kubernetes With Minikube On Ubuntu 18.04 LTS appeared first on CODESPOSTS.COM.

Go to Source
Author: staff

Ubuntu Server Admin

Recent Posts

How to Deploy PowerDNS Cluster on Ubuntu VPS Servers

This article provides a detailed guide for how to deploy PowerDNS cluster on Ubuntu VPS…

8 hours ago

KubeCon Europe 2025: Containers & Connections with Ubuntu

It’s hard to believe that the first KubeCon took place nearly 10 years ago. Back…

2 days ago

The State of Silicon and Devices – Q1 2025 Roundup

Welcome to the first quarterly roundup on the State of Silicon and Devices by Canonical. …

3 days ago

Ubuntu Confidential VMs Now Available on Google Cloud A3 with NVIDIA H100 GPUs

Organizations are racing to harness the transformative power of AI, but sensitive data privacy and…

3 days ago

How to Install a Specific Version of LLVM on Ubuntu or Debian Linux

In this article, we will see how to install a specific version of llvm on…

3 days ago

Ubuntu 25.04 (Plucky Puffin) Beta released

The Ubuntu team is pleased to announce the Beta release of the Ubuntu 25.04 Desktop,…

3 days ago