Atlantic.Net Blog

How to Install Kubernetes with Minikube on CentOS 8

Hitesh Jethva
by Atlantic.Net (125posts) under VPS Hosting
0 Comments

Minikube is an open-source software written in Go and used for setting up a Kubernetes cluster on your local machine. Developers or administrators mainly use Minikube for testing purposes. This cross-platform software can be run on macOS, Linux, and Windows.

In this tutorial, we will learn how to install Kubernetes with Minikube on CentOS 8.

Prerequisites

  • A fresh CentOS 8 VPS with at least 2GB RAM on the Atlantic.Net Cloud Platform
  • A root password configured on your server

Step 1: Create Atlantic.Net Cloud Server

First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing CentOS 8 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged in to your CentOS 8 server, run the following command to update your base system with the latest available packages.

dnf update -y

Step 2: Install Docker

By default, the Docker package is not available in the CentOS 8 default repo, so you will need to add the Docker repo in your system.

You can add it with the following command:

dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

After adding the Docker repo, install Docker by running the following command:

dnf install docker-ce --nobest -y

Once the installation is completed, start the Docker service and enable it to start at system reboot:

systemctl start docker
systemctl enable docker

You can also verify the installed version of Docker using the following command:

docker -v

You should see the following output:

Docker version 19.03.12, build 48a66213fe

Step 3: Install Kubectl

Before starting, you will need to install the required dependencies in your system. You can install them with the following command:

dnf install curl conntrack -y

Next, you will need to install Kubectl in your system. By default, kubectl is not included in CentOS 8, so you will need to install it using the curl command:

curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s 
https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl

Next, give the execution permission to the downloaded binary and move it to the /usr/local/bin directory:

chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl

You can now verify the Kubectl version with the following command:

kubectl version --client

You should see the following output:

Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.5", 
GitCommit:"e6503f8d8f769ace2f338794c914a96fc335df0f", GitTreeState:"clean", 
BuildDate:"2020-06-26T03:47:41Z", GoVersion:"go1.13.9", Compiler:"gc", 
Platform:"linux/amd64"}

Step 4: Install Minikube

First, download the Minikube binary package using the curl command:

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

Next, give the execution permission to the downloaded binary with the following command:

chmod +x minikube

Next, install Minikube by running the following command:

install minikube /usr/local/bin/

You can now start Minikube using the following command:

minikube start --driver=none

Once Minikube is started successfully, you should get the following output:

The above command will download and start the Docker containers for setting up a single node Kubernetes cluster.

You can also verify the status of the Kubernetes cluster with the following command:

minikube status

You should see the following output:

minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

You can also view the cluster information using the following command:

kubectl cluster-info

You should see the following output:

Kubernetes master is running at https://your-server-ip:8443
KubeDNS is running at https://your-server-ip:8443/api/v1/namespaces/kube-system/services/kube-
dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

You can also view the cluster nodes using the following command:

kubectl get nodes

You should get the following output:

NAME STATUS ROLES AGE VERSION
minicube Ready master 2m v1.18.3

Step 5: Verify Kubernetes Cluster

Now, deploy a k8s using echoserver image to test the Kubernetes cluster.

kubectl create deployment test-minikube --image=k8s.gcr.io/echoserver:1.10

You should see the following output:

deployment.apps/test-minikube created

Now, expose your deployment on port 8080 using the following command:

kubectl expose deployment test-minikube --type=NodePort --port=8080

You should see the following output:

service/test-minikube exposed

Next, get the information about your exposed deployment using the following command:

kubectl get pod

You should see the following output:

NAME READY STATUS RESTARTS AGE
test-minikube-f4df69575-7m2pl 1/1 Running 0 33s

Next, get the URL of your deployment using the following command:

minikube service test-minikube --url

You should see the following output:

http://your-server-ip:31186

Now, open your web browser and access the above URL http://your-server-ip:31186. You should see the following screen:

Step 6 : Enable Kubernetes Dashboard

Kubernetes comes with a web dashboard that can be used to manage your cluster through a web browser. By default, the dashboard is disabled in Minikube.

You can list all Minikube addons using the following command:

minikube addons list

You should see the following output:

|-----------------------------|----------|--------------|
| ADDON NAME | PROFILE | STATUS |
|-----------------------------|----------|--------------|
| ambassador | minikube | disabled |
| dashboard | minikube | disabled |
| default-storageclass | minikube | enabled ✅ |
| efk | minikube | disabled |
| freshpod | minikube | disabled |
| gvisor | minikube | disabled |
| helm-tiller | minikube | disabled |
| ingress | minikube | disabled |
| ingress-dns | minikube | disabled |
| istio | minikube | disabled |
| istio-provisioner | minikube | disabled |
| logviewer | minikube | disabled |
| metallb | minikube | disabled |
| metrics-server | minikube | disabled |
| nvidia-driver-installer | minikube | disabled |
| nvidia-gpu-device-plugin | minikube | disabled |
| olm | minikube | disabled |
| registry | minikube | disabled |
| registry-aliases | minikube | disabled |
| registry-creds | minikube | disabled |
| storage-provisioner | minikube | enabled ✅ |
| storage-provisioner-gluster | minikube | disabled |
|-----------------------------|----------|--------------|

Now, enable the Minikube dashboard and get the URL of the dashboard with the following command:

minikube dashboard --url

This will enable the Minikube dashboard as shown below:

* Enabling dashboard ...
* Verifying dashboard health ...
* Launching proxy ...
* Verifying proxy health ...
http://127.0.0.1:42939/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-
dashboard:/proxy/

Now, you can access the Minikube dashboard locally using the above URL.

Conclusion

Congratulations! You have successfully installed Kubernetes cluster with Minikube on CentOS 8. You can now start experimenting with Kubernetes locally. Get started with Kubernetes and Minikube on VPS Hosting from Atlantic.Net today!

Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources