Step 2: Kubernetes Cluster
In this step, we will setup a Kubernetes cluster using
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.
Make sure kind is installed
# kind v0.18.0 go1.20.2 linux/amd64
Make sure docker is running, and you have access to it.
kind create cluster --name starship
Note: Kind will create an entry in the kubeconfig file and set the context to the new cluster.
Docker Desktop includes a standalone Kubernetes server and client, as well as Docker CLI integration that runs on your machine.
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
# list of all the contexts
kubectl config get-contexts
# set the context to docker-desktop
kubectl config use-context docker-desktop
Detailed Reference: https://docs.docker.com/desktop/kubernetes/ (opens in a new tab)
Kind will run a k8s cluster with docker. You can check the nodes with
kubectl get nodes