Local K8S Development

by

in

✏️ Summary

I am constantly researching technology for my work and personal projects. Most recently, I’ve been diving into the state of local K8S development. There are many options out there now that support local development, remote development, and a mixture of both. This is super awesome compared to the state of things a few years ago. During my research, I decided to go with one of the more popular mature projects, Tilt. This project recently had its team join Docker. Which I’m hoping will help the project grow and mature with more resources. It is a simple, easy to use, well documented solution that works well and definitely covers the use case for the video associated with this blog post.

I have also been diving into many of the projects being incubated by the Cloud Native Computing Foundation. If one were to glance at the landscape of all the projects being incubated by CNCF, they could start to piece together that many of the key products and services offered by cloud providers are available here as open-source projects. CNCF is incubating projects that can run on k8s, which can augment most of the crucial services offered by cloud providers. Essentially, CNCF is incubating an open-source cloud. Once I pieced this together, I decided to dive into CNCF incubated projects to learn what, I believe, is the future of the cloud ecosystem.

The reason a tech stack such as this is important is that it can truly be run anywhere. At your home lab, at on-premise and on datacenter, at cloud providers, and any hosting provider that lets you spin up servers. One of the key reasons that I think k8s is the ideal platform for most projects is that you can set fixed costs. What I mean by that is that unlike cloud hosted Serverless platforms that charge by usage, you can spin up a basic high availability k8s cluster for a fixed monthly cost. Then, if architected well using an event-driven approach, resources to be flexed appropriately to keep things running smoothly at reasonable costs.

If you just need a basic web application with a simple API, there are many providers out there that can run this for near free every month. However, if you are trying to run a more advanced application that requires always running services, background processes, has many moving pieces, and is constantly crunching data, hosted serverless platforms can get pricey. As a cost conscious pragmatic engineer, I enjoy the control and flexibility that K8S offers without having to worry about a spike in traffic or a malicious actor DDoSing my services. That type of action would skyrocket the costs of a hosted serverless platform and more than likely cause the services to go down due to hitting any acceptable use service limits imposed on many platforms.

💪 local-k8s-demo

As part of this effort of learning, I have created a video demonstration of how I went about creating a basic project to show one of the many ways to develop a project locally using K8S.

🎁 What is included

  •  Monorepo
  •  Local K8S development
  •  Web Application / API
  •  Worker Service
  •  Database
  •  Queue
  •  Event based auto-scaling

💻 Tech Stack

✅ Repository

local-k8s-demo

📼 Media

Part 1 – Setup, Overview, and Demo

Part 2 – Tiltfile

Part 3 – Remote Debugging

Part 4 – Hot Reloading

Part 5 – Observability

Discover more from Jerry Emilo

Subscribe now to keep reading and get access to the full archive.

Continue reading