Minikube is an open-source tool that enables developers to run Kubernetes locally on their computers. It is designed to make it easy to set up a single-node Kubernetes cluster for development and testing purposes. In this tutorial, we will show you how to install Minikube on CentOS 8.
Prerequisites:Before we begin, ensure that you have the following prerequisites:
- A CentOS 8 server with sudo privileges.
- A terminal emulator such as GNOME Terminal or xterm.
- An internet connection.
Table of Contents
- Install KVM and Libvirt
- Install Minikube
- Verify the Installation
- Starting and Stopping Minikube
- Running Your First Kubernetes Application on Minikube
Commands:The following commands will be used in this tutorial:
- sudo dnf install libvirt libvirt-devel libvirt-daemon-kvm qemu-kvm -y
- sudo systemctl enable --now libvirtd
- curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
- sudo install minikube-linux-amd64 /usr/local/bin/minikube
- minikube version
Step by Step Instructions:
Step 1: Install KVM and Libvirt
The first step is to install KVM and Libvirt. These are required for Minikube to work properly.
Run the following command to install KVM and Libvirt:
sudo dnf install libvirt libvirt-devel libvirt-daemon-kvm qemu-kvm -y
Once the installation is complete, enable and start the Libvirt service:
sudo systemctl enable --now libvirtd
Step 2: Install Minikube
The next step is to download and install Minikube. To do this, run the following commands:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
Step 3: Verify the Installation
To verify that Minikube has been installed correctly, run the following command:
This should output the current version of Minikube.
Step 4: Starting and Stopping Minikube
To start Minikube, run the following command:
This command will start a single-node Kubernetes cluster on your local machine. To stop Minikube, run the following command:
Step 5: Running Your First Kubernetes Application on Minikube
To run your first Kubernetes application on Minikube, you need to deploy a sample application. Run the following command to deploy the Kubernetes dashboard:
minikube kubectl -- create deployment kubernetes-dashboard --image=kubernetesui/dashboard:v2.0.0-beta8
This will deploy the Kubernetes dashboard. To access it, run the following command:
minikube kubectl -- create service nodeport kubernetes-dashboard --tcp=443:443 --node-port=30000
This will expose the Kubernetes dashboard on port 30000. To access the dashboard, open your web browser and go to https://localhost:30000.
In this tutorial, we have shown you how to install Minikube on CentOS 8. With Minikube, you can easily set up a local Kubernetes cluster for development and testing purposes. We hope this tutorial has been helpful to you.
Related Searches and Questions asked:
That's it for this post. Keep practicing and have fun. Leave your comments if any.