1080*80 ad

Install Minikube on CentOS Stream 10

How to Install Minikube on CentOS Stream 10: A Step-by-Step Guide

Developing and testing applications for Kubernetes can be complex, but setting up a local development environment doesn’t have to be. Minikube is a powerful tool that allows you to run a single-node Kubernetes cluster directly on your local machine, making it perfect for developers, students, and anyone looking to learn Kubernetes without the overhead of a full-scale cloud deployment.

This comprehensive guide will walk you through the process of installing Minikube on CentOS Stream 10. We’ll cover everything from system preparation to starting your first local cluster, ensuring you have a smooth and successful setup.

Prerequisites

Before we begin, ensure you have the following:

  • A system running CentOS Stream 10.
  • Sudo or root access to install software and manage services.
  • A stable internet connection to download necessary packages.
  • At least 2 CPUs, 2GB of RAM, and 20GB of free disk space for Minikube to run effectively.

Step 1: Update Your System

First, it’s always a best practice to ensure your system’s packages are up to date. This helps prevent potential conflicts and security vulnerabilities. Open your terminal and run the following command:

sudo dnf update -y

Step 2: Install a Virtualization Driver

Minikube requires a hypervisor, or virtualization driver, to create the virtual machine that will host your Kubernetes cluster. For a Linux system like CentOS Stream, the native choice is KVM (Kernel-based Virtual Machine), which offers excellent performance.

  1. Install KVM and related tools:
    Run this command to install the necessary packages for KVM and virtualization management.

    sudo dnf install @virtualization -y
    
  2. Start and Enable the libvirtd Service:
    The libvirtd daemon manages the virtualization platform. We need to start it and enable it to launch automatically on system boot.

    sudo systemctl start libvirtd
    sudo systemctl enable libvirtd
    
  3. Add Your User to the libvirt Group:
    To manage virtual machines without needing to use sudo for every command, you must add your user account to the libvirt group. This is a crucial security and convenience step.

    sudo usermod -aG libvirt $(whoami)
    

    Important: You must log out and log back in for this group change to take effect. You can verify your membership with the groups command after logging back in.

Step 3: Install kubectl

The kubectl command-line tool is the primary way you will interact with your Kubernetes cluster. You use it to deploy applications, inspect resources, and manage the cluster’s state.

  1. Download the kubectl binary:

    curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
    
  2. Make the binary executable and move it to your PATH:
    This makes the kubectl command available system-wide.

    chmod +x ./kubectl
    sudo mv ./kubectl /usr/local/bin/kubectl
    
  3. Verify the installation:
    Check the version to confirm kubectl is installed correctly.

    kubectl version --client
    

Step 4: Install Minikube

With the prerequisites in place, we can now install Minikube itself.

  1. Download the latest Minikube binary:

    curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
    
  2. Install the binary:
    Use the install command to move the binary to /usr/local/bin, which also sets the correct permissions.

    sudo install minikube /usr/local/bin/
    
  3. Verify the Minikube installation:

    minikube version
    

Step 5: Start Your Minikube Cluster

You are now ready to start your local Kubernetes cluster. This command will download the necessary container images and configure a single-node cluster using the KVM driver we installed earlier.

minikube start --driver=kvm2

The process may take a few minutes as it downloads the required components for the first time. Once complete, you will see a success message indicating your cluster is running.

Step 6: Verify and Interact with Your Cluster

Now that your cluster is running, let’s confirm everything is working correctly.

  1. Check Minikube Status:
    This command provides a quick overview of the host, Kubernetes components, and kubectl configuration.

    minikube status
    
  2. Use kubectl to Check Nodes:
    Run a kubectl command to ensure it can communicate with your new cluster. This command should show a single node with a “Ready” status.

    kubectl get nodes
    

    You have now successfully deployed a local Kubernetes cluster on CentOS Stream 10!

Essential Minikube Management Commands

Here are a few more useful commands for managing your local environment:

  • Access the Kubernetes Dashboard: Minikube comes with a built-in web-based dashboard.

    minikube dashboard
    
  • Stop the Cluster: To pause the cluster without deleting it, freeing up resources:

    minikube stop
    
  • Delete the Cluster: To completely remove the cluster and all its data:

    minikube delete
    
  • SSH into the Cluster: For advanced debugging, you can get a shell inside the Minikube virtual machine:
    bash
    minikube ssh

With Minikube installed, you now have a powerful and flexible environment for building, testing, and learning Kubernetes right from your CentOS Stream machine.

Source: https://infotechys.com/install-minikube-on-centos-stream-10/

900*80 ad

      1080*80 ad