Get Started
Step 2

Step 2: Kubernetes Cluster

In this step, we will setup a Kubernetes cluster using Docker Desktop or kind. Optionally if you have a Kubernetes cluster already, you can skip this step.

By the end of this tutorial you should be able to run kubectl get nodes and see a list of nodes.

Please follow any one of the following sections to setup a Kubernetes cluster.

2.1.1) Recommended: Setup with Docker Desktop

Docker Desktop includes a standalone Kubernetes server and client, as well as Docker CLI integration that runs on your machine.

Enable kubernetes

To enable Kubernetes in Docker Desktop:

  • From the Docker Dashboard, select the Settings.
  • Select Kubernetes from the left sidebar.
  • Next to Enable Kubernetes, select the checkbox.
  • Select Apply & Restart to save the settings and then click Install to confirm.

Note: You might want to increase the memory and cpu allocated to the cluster, in Settings, Resources

Connect with kubectl

# list of all the contexts
kubectl config get-contexts
# set the context to docker-desktop
kubectl config use-context docker-desktop

Detailed Reference: (opens in a new tab)

2.1.2) Alternative: Setup with Kind Cluster

Install Kind

Follow the steps in the official documentation to install kind: (opens in a new tab)

Make sure kind is installed

kind version
# kind v0.18.0 go1.20.2 linux/amd64

Make sure docker is running, and you have access to it.

docker ps

Create kind cluster


kind create cluster --name starship

Note: Kind will create an entry in the kubeconfig file and set the context to the new cluster.

Detailed Reference: (opens in a new tab)

2.2) Check Access to kubernetes

Once you are connected to a kubernetes cluster, you should be able to run the following command and see a list of nodes.

kubectl get nodes