Skip to content

Deploy a local Kubernetes Cluster

If you do not have access to a managed Kubernetes cluster you can deploy one on your local machine or VM. This document describes deploying a cluster with kind. Refer to the documentation for additional information.

Demo Use Only

The instructions in this document are for testing and learning, and not intended for use in production.

Why not Docker Desktop?

The process outlined on this page will create a Kubernetes in Docker (kind) cluster. Kind is very similar in functionality to the Docker Desktop implementation of Kubernetes, but the advantage here is that it is more portable (not requiring Docker Desktop). In addition, the files provided will enable and deploy an ingress controller for communicating with the services in the cluster. In the Getting Started example, port-forwarding was needed with Docker Desktop. With the ingress in place, a port-forward is not required.


Docker System Resources

Docker on Linux is typically installed with root privileges and thus has access to the full resources of the machine. Docker Desktop for Mac and Windows provides a way to set the resources allocated to Docker. For this documentation, a Macbook Pro was configured to use 3 CPUs and 6 GB Memory. You can adjust these values as necessary for your needs.

Kubernetes Version

For this guide, the kind implementation of Kubernetes 1.24 is used.


  1. Install kind on your platform.

  2. Use the provided sample kind.yaml file to create a kind cluster named ping with ingress enabled. From the root of the repository code, run:

    kind create cluster --config=./20-kubernetes/kind.yaml


  3. Test cluster health by running the following commands:

    kubectl cluster-info
    # Output - port will vary
    Kubernetes control plane is running at
    CoreDNS is running at
    To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
    kubectl version --short
    < output removed >
    Server Version: v1.24.0
    kubectl get nodes
    NAME                 STATUS   ROLES           AGE     VERSION
    ping-control-plane   Ready    control-plane   4m26s   v1.24.0
  4. Next, install the nginx-ingress-controller for kind. In the event the Github file is unavailable, a copy has been made to this repository here.

To use the Github file:

kubectl apply -f

To use the local copy:

kubectl apply -f ./20-kubernetes/kind-nginx.yaml

  1. To wait for the Nginx ingress to reach a healthy state, run the following command. You can also observe the pod status using k9s or by running kubectl get pods --namespace ingress-nginx. You should see one controller pod running when the ingress controller is ready. This command should exit after no more than 90 seconds or so, depending on the speed of your computer:

    kubectl wait --namespace ingress-nginx \
      --for=condition=ready pod \ \
  2. Verify nginx-ingress-controller is working:

    curl localhost


    <head><title>404 Not Found</title></head>
    <center><h1>404 Not Found</h1></center>

Our examples will use the Helm release name myping and DNS domain suffix * for accessing applications. You can add all expected hosts to /etc/hosts:

echo '' | sudo tee -a /etc/hosts > /dev/null

Setup is complete. This local Kubernetes environment should be ready to deploy our Helm examples

Stop the cluster

When you are finished, you can remove the cluster by running the following command. Doing so will require you to create the cluster and install the ingress controller when you want another cluster.

kind delete cluster --name ping