How to Install Kubernetes Minikube on CentOS 9

Dear friends, today we will see how to install Kubernetes Minikube on CentOS 9, So let’s start and see step by step this process.

In the world of Kubernetes and container orchestration, Minikube provides a fantastic way to experiment and develop locally before deploying applications to production environments. It creates a single-node Kubernetes cluster on your local machine, enabling you to test and learn Kubernetes without needing to provision complex cloud-based infrastructure.

This article will guide you step-by-step through installing Minikube on CentOS 9. From system prerequisites to installation, configuration, and first-time setup, you’ll be able to get your own Minikube environment up and running in no time.

We will follow these steps to install Kubernetes Minikube on CentOS 9

  1. Prerequisites
  2. Installing Dependencies
  3. Downloading and Installing Minikube
  4. Starting Minikube
  5. Verifying the Installation
  6. Using Minikube
  7. Troubleshooting
  8. Conclusion

1. Prerequisites

Before installing Kubernetes Minikube on CentOS 9, there are a few things you need to ensure your system is ready for the installation:

a) Hardware Requirements to install Kubernetes Minikube :

  • CPU: A processor that supports virtualization (Intel VT-x or AMD-V).
  • RAM: Minimum of 2GB of RAM, but 4GB or more is recommended for smoother performance.
  • Disk Space: At least 2GB of available disk space for Minikube itself, plus space for the Kubernetes components and any Docker images you will use.

b) Software Requirements to install Kubernetes Minikube:

  • CentOS 9 Operating System: Ensure you have CentOS 9 installed and up to date.
  • Docker or VirtualBox: Minikube requires a container runtime, such as Docker, or a virtual machine manager, like VirtualBox.

If you don’t already have Docker or VirtualBox installed, you’ll need to do so first.

2. Installing Dependencies

Minikube requires certain dependencies to run on CentOS 9. The primary ones are Docker (for container management) and kubectl (the Kubernetes command-line tool). You will also need curl to fetch Minikube binaries, and VirtualBox or KVM for virtualization support if you prefer to use a VM backend instead of Docker.

Step 1: Install Docker

To install Docker on CentOS 9, follow these steps:

  • Update your system:
install-kubernetes-minikube
install-kubernetes-Minikube
  • Install required packages:
  • Add Docker repository:
  • Install Docker:
  • Start and enable Docker service:
  • Verify Docker installation:

If everything went well, this should output the version of Docker installed.

Step 2: Install kubectl

kubectl is the command-line interface for interacting with Kubernetes clusters. To install kubectl on CentOS 9, follow these steps:

  • Download the kubectl binary:
  • Make the binary executable:
  • Move the binary to a directory in your PATH:
  • Verify kubectl installation:

If the installation was successful, this should display the kubectl client version.

3. Downloading and Installing Minikube

Now that Docker and kubectl are installed, we can move on to installing Minikube.

Step 1: Download Minikube

  • Download the Minikube binary:
  • Make the binary executable:
  • Move the binary to a directory in your PATH:
  • Verify Minikube installation:

You should now see the version of Minikube you just installed.

4. Starting Minikube

Minikube can run with different virtual machine backends like Docker, VirtualBox, and KVM. By default, Minikube uses Docker as its container runtime, but you can specify other backends as needed.

Step 1: Start Minikube with Docker

To start a Minikube cluster using Docker as the container runtime, simply run:

This command starts Minikube with Docker as the underlying virtualization driver. It will download the necessary Kubernetes images and set up a local Kubernetes cluster.

You can also use other drivers like virtualbox or kvm by replacing –driver=docker with the desired driver.

Step 2: Check the Status

Once Minikube starts, you can check the status of your cluster:

This will show the status of the Kubernetes cluster, the Minikube VM, and the Docker daemon.

5. Verifying the Installation

Once your cluster is up and running, verify that everything is working by using kubectl to interact with the Kubernetes API.

Step 1: Set kubectl Context

Minikube sets up a Kubernetes context for you to use with kubectl. To ensure kubectl is using the correct context, run

Step 2: Verify Cluster Information

Check the Kubernetes cluster’s health by running:

Kubernetes master is running at https://192.168.49.2

Step 3: List Nodes

To verify that your Kubernetes cluster has nodes running, use:

You should see a single node listed, with the status “Ready”.

6. Using Minikube

Now that Minikube is installed and running, you can start deploying applications to your local Kubernetes cluster. Here’s a basic example of how to deploy a simple app.

Step 1: Create a Deployment

To create a deployment, run:

This will create a deployment named hello-minikube running the echoserver image.

Step 2: Expose the Deployment

To expose the deployment as a service, use the following command:

This creates a NodePort service, allowing you to access the deployment via a port on your local machine.

Step 3: Access the Application

To get the URL to access the application, use the following:

This will return a URL you can visit in your browser to access the running application.

7. Troubleshooting

While Minikube is easy to set up, you may encounter a few common issues. Here are some common troubleshooting tips:

Issue 1: Minikube Fails to Start

If Minikube fails to start, ensure that your system supports virtualization (check that Intel VT-x or AMD-V is enabled in your BIOS). Additionally, verify that Docker or your chosen VM driver is installed and running correctly.

You can check the logs of Minikube with:

This will give you detailed logs to help diagnose the issue.

Issue 2: Kubernetes Dashboard Not Available

To enable the Kubernetes dashboard for a more visual experience, run:

This will start the Kubernetes dashboard in your default web browser.

Issue 3: Insufficient Resources

If Minikube is running slowly, you may need to adjust the resources allocated to the Minikube VM. You can specify more CPU and memory like this:

8. Conclusion

Congratulations! You’ve successfully installed Minikube on CentOS 9. You now have a local Kubernetes environment where you can deploy and manage containerized applications. Minikube is an excellent tool for learning Kubernetes, testing new configurations, and experimenting with cloud-native technologies.

If you encounter any issues or need further assistance, don’t hesitate to refer to the Minikube documentation or community forums for more help. Happy Kubernetes-ing!

You can also check this link related to kubernetes:-

How to create ReplicaSet in kubernetes

How to Manage Containers in Kubernetes?

Kubernetes Networking Concepts, Architecture, and Best Practices

What is Kubernetes ReplicaSet and How to create it in Kubernetes?

Leave a Reply