Setting up a Kubernetes cluster at home

Working with Kubernetes

How can I use Kubernetes at home?

There are several ways that you can practice kubernetes. Spin up cloud resources, K3S, or my favorite K3d.

K3d is a wrapper around K3s, which run in docker container(s). This allows you to quickly deploy and destory clusters. It also allows you to have multi-node clusters, within a single host, to allow you to see how failover and other high availability services work.

Okay, How can I get started?

First you will need Docker installed. I will not be going over that in this document. Please refer to my other container documents. [links coming soon].

Next will be to install the k3d toolset. This can be accomlplished by the following command.

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

Important: As always, please review the script before piping to bash. This could lead to bad things.

Now the hard part. Creating the cluster. Lets create a cluster called theBestCluster. Run the following command.

k3d cluster create theBestCluster

It'll do magical things such as pulling images and will start the cluster.

k3d_cluster

How can I create multiple node clusters?

With the command below.

k3d cluster create multi-node-cluster --agents 2