Motivation Link to heading

In the spirit of Valentine’s Day, being kind to yourself and those around you is essential. It is important to treat yourself but be aware of your financial situation.

This post concerns leveraging KIND clusters for your Kubernetes development to avoid spending unnecessary costs using cloud-provided clusters. You will spend about ~30 dollars monthly for a small 2-node cluster. You can use that money you saved to buy your significant other flowers.

Steps Link to heading

I used this site for documentation: https://kind.sigs.k8s.io/docs/user/quick-start/

Coding exists in this repository

  1. To get started, you must install KIND brew install kind

  2. Clone repository

  3. Change directory be-kind-to-yourself

  4. Create a kind cluster that uses custom configuration kind create cluster --config kind-config.yaml --name development

  5. Create local docker image for local kind_app by running make build

  6. Move to project directory and load image in kind cluster make load_image

  7. Once the image gets loaded in the KIND cluster, you can deploy Kubernetes deployment by running make deploy

  8. For testing, you will have to port forward deployment, make a request, and then get logs. There are makefile commands you can use;

    1. make port_forward

    2. make request

    Expected output

    $: make request
    Hello world from app-5b8b656b77-7p6lb in default deployed in development-worker3%
    
  9. Once you have gotten the expected, you can run make clean_up to clean up deployment and local kind cluster

Learnings Link to heading

With setting up a local kind cluster, you can go through the exercise of creating and deleting Kubernetes resources locally to flush out any integrations you will face if you need to deploy to your development and production clusters.

Things that we learned doing this project/post are

  • Create a primary Golang HTTP server
  • Create a Golang app docker image
  • Create a Kubernetes deployment
  • Learn how to port forward and make requests to deployments in the local kind cluster

Learning and experimenting more about Kubernetes without spending a dime got me feeling like this.