How spending a weekend setting up a Kubernetes cluster made me see cloud computing in a new light - Part 1

·

4 min read

I'll go through a short recap of history to set the scene and explain how we got to our current state in the cloud, and then I'll introduce the core Kubernetes concepts to help you get started with Kubernetes yourself.

Kubernetes is billed as a container orchestration system. And my goal with this post is to show you a another way of looking at it, one that may change the way you think about building and hosting apps. Kubernetes offers a layer of abstraction that can help you re-think what an app/website really is. The distinctions between frontend, backend, database, infrastructure and product starts to blur. It's all code, and it all works together to form a cohesive whole.

Life before the Cloud

Back in the 90s, if you wanted to launch a tech startup you needed to buy your own servers. Servers were expensive and you also needed to manage all of the config, setup and running of them yourself. Scaling meant physically adding machines to your network and reconfiguring it to load-balance correctly. Things then improved a little with the advent of hosting providers. Companies started renting servers from the hosting companies and could abstract away worrying about the hardware and networking challenges.

The promise of cloud computing is that all the hardware and infrastructure "stuff" is abstracted away so that you the developer can focus on building a great product. Today it's entirely possible to run a large production app in the cloud from just a laptop. But what’s interesting is that when you can abstract away all the hardware, networking, storage and scaling, it magically comes back at you in a brand new way.

Infrastructure as Code (IaC)

With cloud and Infrastructure as Code, you now have a whole set of code and config relating to the what (servers, databases, disk space) and the how (have 2 copies of the api service running and scale up to 5 during high-load) of running your app or service. It becomes a whole new thing: a new layer in your codebase that relates to how you want your service to behave and scale.

You no longer think in terms of machines and servers but in terms of different fault-tolerant replicated services of your app interacting with each other. The level of abstraction has just shifted-up a notch. This is a good thing. You need to understand that your app needs all these things like machines, networks, storage to run. All you have to do is declare your desired setup in code and your cloud provider will set it all up and manage it for you. You can ask for resources like 1CPU and 1GB RAM for your cat gif service and 10GB of SSD space for your cat redis cache for example.

Kubernetes - the new layer

Now is a good time to introduce Kubernetes. As I said earlier, Kubernetes is billed as a container orchestration service. Basically, it will manage your containers, restart them and scale them depending on user demand on your cluster. It handles thing like readiness probes to check if your containers or services are healthy.

You still needed to manage the underlying machines/nodes that it ran on but that changed when Google (who btw invented Kubernetes) introduced Autopilot. With Google Kubernetes Engine's new Autopilot Kubernetes cluster, Google will manage the underlying infrastructure and software upgrades of your cluster. In their own words:

What this means is that you really no longer have to worry about the hardware level. You now need only think in terms of how much compute resource your services needs and Kubernetes will take care of the rest. This opens up a lot of new possibilities, especially for indie devs. You now have very sophisticated and resilient infrastructure right at your fingertips. My prediction is that this will enable the next unicorn tech company to be run by only 1 or 2 people. Instagram was 10 people when it was bought by Facebook in 2012.

In the next part I'll go over the various Kubernetes concepts that enable this new way of thinking about running your platform.


I'm building a web-based crypto trading performance tracker and tax calculation tool called Moonscape: moonscape.app

I'll be posting about dev stuff I have learned on my journey building it. I'm launching the beta soon so please join the wait-list if you're interested.

I also have another post coming up detailing what's coming up in the beta and what dev work is left.

Follow me on twitter @bonfues | MoonscapeHQ

Thanks for reading!