peter (admin)   -  



Installing Minikube on Linux

In this section, we are going to install Minikube so that we can run Kubernetes locally on our Linux system.

Minikube provides a simple way to create a Kubernetes cluster for learning, development, and testing without needing several physical servers.

Before continuing, we should already have completed the basic system preparation and installed a suitable Minikube driver, such as Docker.


What Is Minikube?

Minikube is a tool that allows us to create and run a local Kubernetes cluster.

Instead of manually configuring a control-plane node and multiple worker nodes, Minikube handles much of the Kubernetes setup automatically.

This makes it particularly useful when learning concepts such as:

  • Pods

  • Deployments

  • Services

  • Namespaces

  • ConfigMaps

  • Secrets

  • Storage

  • Networking

  • Scaling

  • Kubernetes troubleshooting

Our basic environment will look like this:

Linux System
     |
     v
  Minikube
     |
     v
Kubernetes Cluster
     |
     +---- Control Plane Components
     |
     +---- Worker Components
     |
     +---- Pods and Services

Check the System Architecture

Before downloading Minikube, it is useful to check the architecture of the Linux machine.

Run:

uname -m

On a typical Intel or AMD 64-bit computer, you should see:

x86_64

For this architecture, we need the AMD64 version of Minikube.


Download Minikube

We can download the Minikube executable using curl.

Run:

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

The curl command downloads the file directly from the internet.

The options:

-L    Follow redirects
-O    Save using the remote filename

tell curl to follow any HTTP redirects and save the downloaded file locally.

The downloaded file will be called:

minikube-linux-amd64

The linux-amd64 part indicates that the executable is intended for 64-bit Linux systems running on the x86-64/AMD64 architecture.


Check the Downloaded File

Once the download has completed, we can confirm that the file exists:

ls -lh minikube-linux-amd64

This displays information about the file, including its size.

You can also check its type:

file minikube-linux-amd64

The output should indicate that it is a 64-bit Linux executable.


Install Minikube

Now we need to place the Minikube executable somewhere that Linux can find when we enter the minikube command.

A standard location for locally installed system-wide executables is:

/usr/local/bin

Install Minikube with:

sudo install minikube-linux-amd64 /usr/local/bin/minikube

We use sudo because a normal user generally does not have permission to write files into /usr/local/bin.

The command may complete without displaying any output.

This is normal.

Many Linux commands display nothing when they complete successfully.


Why Use /usr/local/bin?

The /usr/local/bin directory is normally included in the system's PATH.

You can inspect your current PATH with:

echo $PATH

The PATH tells Linux where to search for executable programs.

Because Minikube has been installed as:

/usr/local/bin/minikube

we can simply run:

minikube

instead of having to enter:

/usr/local/bin/minikube

every time.


Verify the Minikube Installation

After installing Minikube, verify that Linux can find it:

which minikube

You should see:

/usr/local/bin/minikube

This confirms that the executable is installed in a directory available through the PATH.


Check the Minikube Version

Now check the installed Minikube version:

minikube version

The output will look similar to:

minikube version: v1.x.x
commit: xxxxxxxxxxxxxxxxx

The exact version will depend on the current Minikube release when you perform the installation.

The first value identifies the Minikube release version.

The second value is the commit identifier associated with that build.


Why Is the Commit Information Useful?

The commit information identifies the specific source-code revision used to build Minikube.

Normally, you only need the version number, but the commit identifier can be useful when:

  • Troubleshooting a problem

  • Reporting a bug

  • Comparing installations

  • Checking release information

  • Investigating differences between builds

Together, the version and commit information allow us to identify exactly which Minikube build is installed.


Check Minikube Commands

We can now test the command itself:

minikube --help

This displays the commands and options available in Minikube.

Some commands we will eventually use include:

minikube start

to create or start a cluster,

minikube status

to check its status, and:

minikube stop

to stop the cluster.

We can also remove a Minikube cluster using:

minikube delete

Minikube and Docker

If Docker is being used as the Minikube driver, the relationship between the components can be visualized as:

Linux Host
    |
    v
  Docker
    |
    v
 Minikube
    |
    v
Kubernetes Node
    |
    +---- API Server
    |
    +---- Scheduler
    |
    +---- Controller Manager
    |
    +---- etcd
    |
    +---- Kubelet
    |
    +---- Container Runtime
    |
    v
   Pods

Minikube creates and manages the local Kubernetes environment while Docker provides the container-based environment used by the Minikube driver.


Check Docker Before Starting Minikube

If we intend to use Docker as our driver, verify that Docker is running:

systemctl status docker --no-pager

You should see:

active (running)

Then verify that your user can access Docker:

docker ps

If this command works without an error, Docker is ready for Minikube.


Starting Minikube with Docker

Although the purpose of this section is primarily to install Minikube, once everything has been verified we are ready to create our first cluster.

Using Docker as the driver, the command will be:

minikube start --driver=docker

Minikube will then begin creating the local Kubernetes environment.

During the first start, it may need to download Kubernetes components and container images, so the process can take some time depending on the internet connection.


Installation Process Summary

The Minikube installation process can be summarized as:

Check Linux Architecture
          |
          v
Download Minikube
          |
          v
minikube-linux-amd64
          |
          v
Install into /usr/local/bin
          |
          v
Check minikube version
          |
          v
Verify Docker
          |
          v
Minikube Ready

At this stage, we have completed the main prerequisites, installed Docker, and installed Minikube.

Our Linux system is now ready for us to create and start our first local Kubernetes cluster.

 


Comments (0)

There are no comments yet. Be the first to comment.

Log in or register to leave a comment. all comments are subject to admin approval