How to create a local Kubernetes cluster

Kunal Kushwaha avatar
By Kunal Kushwaha
Developer Advocacy Intern


With Civo Academy, Learn how to install Kubernetes, the services & tools to use and how to create a local cluster on your system using Minikube.


How to create a local Kubernetes cluster?

In this video, we'll learn how to install Kubernetes and create a local cluster on your system. Imagine that you want to test something on your Kubernetes cluster quickly, but it is not readily available, and you don't want to set up an entire Kubernetes cluster.

There are some services that you can use, such as Play with K8s that provide a Kubernetes playground, similar to Play with Docker. But, in this particular session, we'll learn about how you can install a Kubernetes Cluster on your local machine.

There are many other resources and ways to do that, but imagine if you're using Docker Swarm, and we have Docker for Mac or Windows, or we can also run it natively on Linux. Execute a single command like Docker Swarm in it, and that's all that's needed to create a local Docker Swarm cluster.

Can we accomplish the same simplicity with Kubernetes? The answer is yes, and the answer is Minikube. We can use Minikube to set up a Kubernetes Cluster. First, let's talk briefly about what Minikube is. It is used to create your Kubernetes cluster if you want to install it on the system, but you have limited resources.

What is Minikube?

Minikube is an all-in-one system, i.e., no multiple architectures of Master and Worker nodes are required. The same system acts as the Master as well as the Worker node. It can be used for testing purposes.

Minikube creates a single node cluster inside a VM on your laptop. Even though it's not ideal for production since we won't be able to demonstrate some of the features Kubernetes provides in a multi-node setup, it should be more than enough to explain most of the concepts behind Kubernetes.

Later on, when we move into a production-ready environment, something using a cloud provider like Civo, for example, then you'll be able to explore all the other features that cannot be demonstrated on Minikube.

Before we dive into Minikube, there are a few prerequisites that we should probably set up. The first one of them is Kubectl. Kubectl is a Kubernetes command-line tool used to manage a cluster and applications running inside it.

We'll use Kubectl a lot throughout this course and learn about all the available commands and more.

So, without further ado, let's get started with the installation of Kubectl.

Don't stop now, check out your next lesson