Local stack for kubernetes

Antoine - Jun 28 '20 - - Dev Community

Photo by Geran de Klerk on Unsplash

I am considering using one kubernetes i our stack. But the thing that stops me is the complexity of maintaining the cluster alive in the Cloud or locally in sync across the team.

It seems 2 tools can help me providing this:

  • Kind, by providing a local kubernetes cluster easy to setup
  • tilt, by providing a way to transition from docker-compose, and ease of development / debug of kubernetes.

Kind

By following the quickstart, i was able to start a cluster with a control plane and a node using the following file

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
  - role: worker

If you have an error saying that yaml cannot be merged, it means that your config file in your C:\Users\My_User.kube has some invalid character. You can delete it, if you can remove the existing context.

Then, a

kind create cluster --config=kind.config.yaml

brings me my cluster.

Tilt

I had followed the example, that you can find on github.

The only issue for me was that the port 8000 was blocked so i had to change all references in tiltfile, kubernetes.yaml, and sh to 8001.

Do not forget to kill your cluster as it can eat all your memory.

kind delete cluster

Update: Daniel Neumann write a good blog about setuping KinD locally

Hope this helps !

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player