Local Kubernetes Cluster

Learn how we can create a Kubernetes cluster on the local machine.

This lesson will walk us through building a single-node Kubernetes cluster with Docker Desktop.

We’ll need to complete the following steps to build the cluster:

  • Install Docker Desktop

  • Enable Docker Desktop’s built-in Kubernetes cluster

  • Test our cluster

Install Docker Desktop

Docker Desktop is the easiest way to get Docker, Kubernetes, and kubectl on the laptop. We also get a nice UI that makes switching between kubectl contexts easy.

kubectl is the Kubernetes command line utility, and we’ll need it for all the examples in the course.

A kubectl context is a collection of settings telling kubectl which cluster to issue commands to and which credentials to authenticate with.

Complete the following simple steps to install Docker Desktop:

  1. Search the web for Docker Desktop

  2. Download the installer for the system (Linux, Mac, or Windows)

  3. Fire up the installer and follow the next, next, next instructions

Windows users should install the WSL 2 subsystem when prompted.

After the installation, we may need to start the app manually. Mac users get a whale icon in the menu bar at the top while running, whereas Windows users get the whale in the system tray at the bottom. Clicking the whale exposes some basic controls and shows whether Docker Desktop is running.

Open a terminal and run the following commands to ensure Docker and kubectl are installed and working.

Get hands-on with 1400+ tech skills courses.