Skip to content

Tips for Kind

Alp Tuna edited this page Jan 28, 2025 · 3 revisions

Contents

  1. Pause Kind when not needed
  2. Instal metrics-server locally

Pause Kind when not needed

When you know you are not going to 't work with REANA locally for several hours, you can pause Kind docker process by doing:

$ reana-dev cluster-pause

This will issue docker pause kind-control-plane command internally. Pausing Kind in this manner will help to save some battery life (and some fan noise!).

When you are ready to work on REANA again, you can run:

$ reana-dev cluster-unpause

It may take a few minutes before all the networking between the pods is up and running and the cluster is operational again.

(Note that "unpausing" was sometime causing issues in the past when sleeping for long, moving between countries and wifi networks, and updating operating systems and kernels in the meantime, and whatnot. If it happens that the cluster doesn't wake up, kind delete cluster might be a handy last resort.)

Install metrics-server locally

If kubectl top nodes doesn't work for you locally on Kind, it is because you need Kubernetes metrics-server installed. Please follow these steps:

Install cluster with worker nodes

If you would like to launch the kind cluster with worker nodes to have a more realistic production scenario, you can specify the --worker-nodes flag. By this approach, you have not only the control plane but also some worker nodes inside yourlocal kind cluster.

An example command to create the cluster with 3 worker nodes could be

$ reana-dev cluster-create -m /var/reana:/var/reana --mode debug --worker-nodes 3

You can check that the cluster is indeed created with worker nodes by kubectl get nodes.

$ kubectl get nodes
NAME                 STATUS   ROLES           AGE     VERSION
kind-control-plane   Ready    control-plane   4m30s   v1.30.0
kind-worker          Ready    <none>          4m7s    v1.30.0
kind-worker2         Ready    <none>          4m8s    v1.30.0
kind-worker3         Ready    <none>          4m9s    v1.30.0
$ kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
$ kubectl edit -n kube-system deployment/metrics-server
# Add `--kubelet-insecure-tls` to `spec.template.spec.containers[0].args` and save.