Skip to content

Latest commit

 

History

History
70 lines (39 loc) · 2.31 KB

README.md

File metadata and controls

70 lines (39 loc) · 2.31 KB

Running a Local Kubernetes Cluster

Kubernetes clusters can have hundreds of nodes in production, but you can run a single-node cluster on your laptop and it works in the same way.

We'll also use Git for source control, so you'll need a client on your machine to talk to GitHub.

Git Client - Mac, Windows or Linux

Git is a free, open source tool for source control:

Docker Desktop - Mac or Windows

If you're on macOS or Windows 10 Docker Desktop is the easiest way to get Kubernetes:

The download and install takes a few minutes. When it's done, run the Docker app and you'll see the Docker whale logo in your taskbar (Windows) or menu bar (macOS).

On Windows 10 the install may need a restart before you get here.

Right-click that whale and click Settings:

In the settings Windows select Kubernetes from the left menu and click Enable Kubernetes:

Docker downloads all the Kubernetes components and sets them up. That can take a few minutes too. When the Docker logo and the Kubernetes logo in the UI are both green, everything is running.

OR k3d - Linux

Running Kubernetes inside a container

On Linux k3d is a lightweight Kubernetes distribution with a good feature set. It runs a whole Kubernetes cluster inside a Docker container :)

You can use k3d on macOS and Windows too - but Docker Desktop is easier.

You need to install Docker, then k3d and then create a cluster:

curl -fsSL https://get.docker.com | sh

curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash

k3d cluster create k8s -p "30000-30040:30000-30040@server:0"

Check your cluster

Whichever setup you use, you should be able to run this command and get some output about your cluster:

kubectl get nodes

I'm using Docker Desktop and mine says:

NAME             STATUS   ROLES    AGE    VERSION
docker-desktop   Ready    master   5d4h   v1.19.7

Your details may be different - that's fine. If you get errors then we need to look into it, because you'll need your own cluster for every part of the course.