Kubernetes Cheatsheet 1 — Setup Minikube

GAURAV MUNJAL
2 min readApr 10, 2021

This is a part of the Kubernetes cheatsheet series, notes for later reference, taken while learning.

Photo by Cathryn Lavery on Unsplash

Why Minikube?

The simplest way to stand up Kubernetes cluster for hands-on practice and learning. Unlike prod level clusters which would otherwise require multiple servers to host master(controller) and worker nodes, minikube runs all essential components of k8s on your laptop/computer.

Requirements to get started and set up a cluster on your local machine:

  • Any machine running Linux/Windows/Mac OS
  • Container runtime installed, the most popular choice is Docker, you may install Docker desktop that has container runtime, get it here
  • If you would like to learn more about docker runtime, you can find a free great resource here
  • Choose between two different ways of setting up k8s(Kubernetes)

MiniKube

  • It's a package that bundles all the required components for Kubernetes
  • Provides single-node Kubernetes cluster
  • Instructions to install Minikube can be found here
  • In order to interact with Kubernetes, we need a command-line utility called kubectl that we could later use to query and perform various actions on Kubernetes objects, get kubectl from here
  • After installing minikube, this is what you should see after you run minikube start
$ minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
timeToStop: Nonexistent
  • Runkubectl get pods -Athis would return the list of pods(unit of atomicity in k8s that hosts one or more containers), if all these pods are in a Running state, it would mean your deployment is successful.
$ kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-74ff55c5b-mrtzh 1/1 Running 0 7d4h
kube-system etcd-minikube 1/1 Running 0 7d4h
kube-system kube-apiserver-minikube 1/1 Running 0 7d4h
kube-system kube-controller-manager-minikube 1/1 Running 0 7d4h
kube-system kube-proxy-5k2l4 1/1 Running 0 7d4h
kube-system kube-scheduler-minikube 1/1 Running 0 7d4h
kube-system storage-provisioner 1/1 Running 1 7d4h
kubernetes-dashboard dashboard-metrics-scraper-f6647bd8c-mffs6 1/1 Running 0 6d21h
kubernetes-dashboard kubernetes-dashboard-968bcb79-jkqv4 1/1 Running 0 6d21h

--

--