Using Minikube for Local Deplyment of single node Kubernetes cluster

Sarthak Srivastava
Sep 29 · 4 min read
Image for post
Image for post
Image for post
Image for post

Kubernetes is an open source container orchestration platform that automates many of the manual processes involved in deploying, managing, and scaling containerized applications. It is also known as k8s.

Kubernetes was originally developed and designed by at Google and was open sourced in 2014.

Advantage of Kubernetes :

  • Orchestrate containers across multiple hosts.
  • Control and automate application deployments and updates.
  • Mount and add storage to run apps.
  • Scale containerized applications and their resources.
  • Manage services which guarantees the deployed applications are always running the way you intended them to run.
  • Health-check and self-heal your apps with auto-placement, auto-restart, auto-replication, and auto-scaling.

Kubernetes is significantly more complex than Swarm, and requires more work to deploy. For development work, and smaller container clusters, Docker Swarm presents a simpler choice.

Image for post
Image for post

Kubernetes is an API server which provides all the operation on cluster using the API.Its basically the entry point .

This component is responsible for most of the collectors that regulates the state of cluster and performs a task.

This is one of the key components of Kubernetes master. It is a service in master responsible for distributing the workload. It is responsible for tracking utilization of working load on cluster nodes.

  • Kubelet: Kubelet ensures that all containers in the node are running and are in the healthy state. Its also responsible for communication between master and worker nodes.
  • Container: Containers are the lowest level of Microservice, placed inside the pod and needs external IP address to view the outside process.
  • Kube Proxy: It acts as a network proxy and a load balancer. It forwards the request to the correct pods across isolated networks in a cluster.

So lets begin with installation . In this pdf I have added all the commands to install docker, kubectl and minikube.

There is a problem with minikube on VirtualBox VM : minikube uses VirtualBox hypervisor for virtualization and thus requires VT-X support on host. However VirtualBox doesn’t support VT-X/AMD-v. That could be solved by using vm-driver=none option and Docker on host and also minimum 2 cores of cpu is allocated .

Image for post
Image for post

We need to install conntrack as prerequisite using

sudo apt-get install conntrack
Image for post
Image for post

Minikube is an indispensable tool for developing applications targeted for Kubernetes.

To launch minikube use

sudo minikube start --vm-driver=none
Image for post
Image for post
minikube start
  1. You can type kubectl, if you’ll see all the commands available that means “kubectl” is working.
Image for post
Image for post

2. Verify Minikube is running.

sudo kubectl get node
Image for post
Image for post

3. Now we start the Deployment on Kubernetes Cluster. We are deploying a docker image available publically on docker hub

Image for post
Image for post
sudo kubectl create deployment <Deployment_Name> --image=<Image_Name>
Image for post
Image for post

4. To get Information of running deployments

sudo kubectl get deployments
Image for post
Image for post

5. To get full description of running deployments

sudo kubectl describe deployments magicalnginx
Image for post
Image for post

6. Make the NGINX container accessible via the internet.

kubectl create service nodeport <deployment_name> --tcp=80:80

7. Run below command to get URL of exposed service

sudo kubectl get svc
Image for post
Image for post

8. Use curl command to view content of web page

Image for post
Image for post

9. Kubectl commands:

  • To list deployments : sudo kubectl get deployments
  • To delete a service : sudo kubectl delete service magicalnginx
  • To delete a particular deployment : sudo kubectl delete deployment magicalnginx
Image for post
Image for post
  • Delete the local Minikube cluster
sudo minikube delete

In the next post I will be

Link : https://medium.com/@sarthak3398/using-kops-to-setup-up-kubernetes-cluster-f83d83139f6a

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data…

By Analytics Vidhya

Latest news from Analytics Vidhya on our Hackathons and some of our best articles! Take a look

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Sarthak Srivastava

Written by

I’m an undergraduate student at IIIT Ranchi, pursuing my B-Tech in Electronics and Communication Engineering.

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem https://www.analyticsvidhya.com

Sarthak Srivastava

Written by

I’m an undergraduate student at IIIT Ranchi, pursuing my B-Tech in Electronics and Communication Engineering.

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem https://www.analyticsvidhya.com

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store