How to Install Minikube on CentOS?
Kubernetes is an open-source container orchestration platform for automating container scalability and deployments. Minikube is a cross-platform that allows administrators to run Kubernetes locally. It helps in deploying single-node Kubernetes clusters on local systems or within VMs or virtual machines
It builds a virtual environment for running Kubernetes clusters on it, allowing users to test in a Kubernetes environment. In this blog post, you will learn how to install and configure Kubernetes on CentOS using Minikube.
What is Minikube?
Written in Go, minikube is a beginner-friendly software that helps in creating Kubernetes clusters on a single server. It just needs a few resources to deploy small Kubernetes clusters. Minikube is mostly used for testing and evaluating multiple Kubernetes scenarios or versions.
All of that is done in a local environment so that the required variables may be reviewed and adjusted by developers before the final launch. Minikube is not suggested for a manufacturing process since it starts a virtual box instance, installs Docker, and deploys the required Kubernetes container within a certain constrained virtual area.
Here are some highlights of minikube:
- Minikube allows users to learn and experiment on Kubernetes and get their hands dirty with its features. It helps developers, both beginners and experienced, to get a better grip on Kubernetes clusters without getting perplexed.
- Minikube is the best way for learning crucial Kubernetes features.
- It helps individuals who intend to experiment with the scope of Kubernetes by adding more features and capabilities and learn all the dynamics of the same.
Installing minikube on CentOS
Before starting with the steps mentioned below, have a look at the prerequisites for installing minikube on CentOS:
- You need to execute the steps mentioned ahead on a dedicated server instead of a virtual private server. The reason behind this is that virtual private servers won’t support virtualization within their environments.
- Having kubectl, which is the command line for Kubernetes, and minikube installed on a system is important. For installing the same, you need to follow the 3rd step mentioned ahead.
- Ensure that your system is running on CentOS 7 or CentOS 8.
- Your user account should have administrative privileges for running sudo codes
- Access to the terminal window and the command line is required.
Now, it’s time to discuss the steps that will allow you to install minikube on your CentOS system:
1. Installing updates
The very first step before installing minikube is ensuring that your system is updated. For this, run the below-mentioned dnf command which will install all the latest available updates required.
[root@minikube-centos8 ~]# dnf update -y
By updating your system, you can make sure that no unnecessary glitches occur while installing minikube.
2. Installing Docker
Since the deployment of the local Kubernetes cluster will be done via minikube on VM, installing Docker on CentOS becomes important. Therefore, run the following commands to download and install Docker:
[root@minikube-centos8 ~]# dnf config-manager –add-repo=https://download.docker.com/linux/centos/docker-ce.repo
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
[root@minikube-centos8 ~]# dnf install docker-ce –nobest -y
Following systemctl commands will help in starting and enabling docker services,
[root@minikube-centos8 ~]# systemctl start docker
[root@minikube-centos8 ~]# systemctl enable docker
3. Installing Kubectl
Kubectl is the command-line tool for Kubernetes that helps individuals to communicate with the environment and take necessary actions as required. Installing and configuring Kubectl is important for working with Kubernetes or minikube. Therefore, run the below-mentioned command in the terminal for downloading the same:
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
The command for giving executive permissions to Kubectl is as follows:
chmod +x kubectl
For moving it into the same directory in which Minikube is saved, use the following command:
sudo mv kubectl /usr/local/bin/
For verifying the installation of Kubectl, run the following command:
kubectl version –client -o json
4. Installing and starting minikube
Now that you’ve installed all the required programs and frameworks, you can proceed with the installation of minikube. Run the following commands for installing minikube on your system:
[root@minikube-centos8 ~]# curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
[root@minikube-centos8 ~]# chmod +x minikube
[root@minikube-centos8 ~]# mkdir -p /usr/local/bin/
[root@minikube-centos8 ~]# install minikube /usr/local/bin/
For starting minikube, run the following Kubectl command:
[root@minikube-centos8 ~]# minikube start –driver=none
Right after executing the aforementioned command, the minikube will automatically download and start docker containers for creating single-node Kubernetes clusters.
For verifying the status of local Kubernetes clusters, run the following command on Kubectl:
[root@minikube-centos8 ~]# minikube status
Now, run the following command for viewing all the cluster nodes:
[root@minikube-centos8 ~]# kubectl get nodes
5. Testing and verifying clusters
For testing and verifying the Kubernetes clusters created in the above steps, an individual has to create Kube deployment with the help of echo server images. It is similar to an HTTP web server and exposes clusters as a service on port 8080. Run the following command:
[root@minikube-centos8 ~]# kubectl create deployment test-minikube —
For accessing the deployment, execute the following commands for exposing it as a service:
[root@minikube-centos8 ~]# kubectl expose deployment test-minikube –type=NodePort –port=8080
6. Enabling and accessing Dashboard
Kubernetes comes with a dashboard for allowing individuals to manage the clusters and other related tasks. However, the dashboard in minikube is added with the help of add-ons. For viewing this addon, along with various other addons, run the following command:
[root@minikube-centos8 ~]# minikube addons list
Execute the below-mentioned command for activating Dashboard in minikube:
[root@minikube-centos8 ~]# minikube dashboard –url
And that’s all! You have successfully installed and configured Minikube on CentOS along with installing Kubectl and Docker.
The blog post contains a step-by-step guide for helping you create and deploy a local Kubernetes environment with the help of minikube on centOS. This will enable you to experiment with Kubernetes, learn its dynamics, and get hands-on experience.
Minikube is a great way for understanding and exploring Kubernetes and Docker Containers, and the best part is that users don’t have to go through the long and complex process of installing the same. Just follow the six simple steps mentioned above to get started with minikube on CentOS.