Introduction
There are multiple ways of setting up kubernetes. To play around or learn kubernetes you can set it up via multiple ways such as:
- Minikube
- MicroK8s
- Kubeadm
The kubeadm tool can also be used for setting up a local viable cluster with the help of a config management tools such as Ansible. A detailed step by step tutorial for installing kuberetes with ansible on a local cluster can be found here.
However for running a prodcuction grade cluster in cloud it’s better to use a managed service from providers such as GCP, AWS, Azure or DigitalOcean.
For a local development or learning setup minikube
is the easiest to start with and we
will go through steps to setup a local minikube cluster.
A typical kubernetes deployments consists of master and worker node with components shown in the image below.

Minikube bundles all these components together in a single node kubernetes cluser. This gives us a simple setup to work and interact with.

Installing Kubectl
To interact with a kubernetes cluster we need a utility kubectl
. The kubectl utility can interact with both local
as well as a remote setup with some configuration.
Inorder to install kubectl utility on linux
- Download the latest release with the command
- Validate the binary Download checksum file
Validate the binary
- Install kubectl
For more detail visit here
If you want to enable shell completion for kubectl then please see this link
it explains how to add it for bash
, fish
and zsh
.
Installing Minikube
To install minikube on linux follow the commands:
- Download the binary
- Install the binary
- Setup a local kubernetes cluster Minikube needs a driver to setup the cluster on the local machine. A list of drivers supported can be found here. I prefer the docker driver as it’s easier to setup and clean and is also a very common utility for dev and ops people. To start the cluster with docker driver, run the command:
To make this the default driver we can run the following command
Once you are done with the setup you can start and stop the cluster with the
help of minikube
.
You can interact with the cluster using kubectl
e.g.
This should return the output as such
NAME STATUS ROLES AGE VERSION
minikube Ready control-plane,master 37h v1.22.3
Summary
In the article we took a look at how to setup kubectl utility and minikube for local development on kubernetes.