Local Cluster Deployment of Kubernetes: A Hands-On Project

Prerequisite Installation

  1. Docker

  1. Minikube

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

Steps to Deploy a Sample Application

After setting up Minikube, follow these steps to deploy a sample application:

  1. Create a Deployment

     kubectl create deployment hello-minikube --image=kicbase/echo-server:1.0
    

    This command creates a deployment named hello-minikube using the kicbase/echo-server:1.0 image.

  2. 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.

  3. Get Service Details

     kubectl get services hello-minikube
    

    This command retrieves the details of the hello-minikube service.

  4. 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.

0
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 systemsand cloud native tools using Golang