Local Cluster Deployment of Kubernetes: A Hands-On Project


Prerequisite Installation
After Installing, run
kubectl get nodes
kubectl dashboard
Understanding Minikube
Minikube is an open-source tool designed to help you run Kubernetes locally on your computer. Kubernetes is a powerful platform used for managing containerized applications across a cluster of machines, but setting up a full Kubernetes cluster can be complex and resource-intensive. Minikube simplifies this by running a single-node Kubernetes cluster inside a virtual machine (VM) on your laptop or desktop. This setup allows developers to experiment with Kubernetes and develop with it day-to-day, without needing to deploy to a full Kubernetes environment.
System Requirements
2 CPUs or more
2GB of free memory
20GB of free disk space
Internet connection
Container or virtual machine manager, such as: Docker, QEMU, Hyperkit, Hyper-V, KVM, Parallels, Podman, VirtualBox, or VMware Fusion/Workstation
Steps to Deploy a Sample Application
After setting up Minikube, follow these steps to deploy a sample application:
Create a Deployment
kubectl create deployment hello-minikube --image=kicbase/echo-server:1.0
This command creates a deployment named
hello-minikube
using thekicbase/echo-server:1.0
image.Expose the Deployment
kubectl expose deployment hello-minikube --type=NodePort --port=8080
This command exposes the deployment as a service, making it accessible via a NodePort on port 8080.
Get Service Details
kubectl get services hello-minikube
This command retrieves the details of the
hello-minikube
service.Access the Service
minikube service hello-minikube
Alternatively, you can use port forwarding to access the service:
kubectl port-forward service/hello-minikube 7080:8080
This command forwards the local port 7080 to port 8080 of the service.
Expected Output
on , http://localhost:7080
Dashboard Preview
Congratulations! You have successfully deployed a sample application on a Kubernetes cluster using Minikube.
Subscribe to my newsletter
Read articles from Sundaram Kumar Jha directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Sundaram Kumar Jha
Sundaram Kumar Jha
I Like Building Cloud Native Stuff , the microservices, backends, distributed systems and cloud native tools using Golang