Avoid small deployments with Kuberetes

Avoid small deployments with Kuberetes
Photo by frank mckenna / Unsplash

If at one point you're start doing large scale cloud deployments, the infrastructure that Kubernetes to automatically manage the scalability of your platform and perform routing of requests is quite handy. But it might not make total sense when just starting out.

This blog, for example runs on the smallest VM provided by Linode, which provides:

  • 1 GB RAM
  • 1 vCPU
  • 25 GB of SSD space

This blog runs sufficiently well and I've got other services that are not computationally expensive that are running on this machine which just costs me $5 / month to run.

The recommended minimum requirements for Kubernetes which are noted here, notes the following:

  • 2 GB or more of RAM per machine (any less will leave little room for your apps)
  • 2 CPUs or more

To attain this minimal configuration on a host in Linode or Digital Ocean, you'll likey need a machine that costs $20/month for:

  • 4 GB RAM
  • 2 vCPUs
  • 80 GB of SSD space

and running a cluster with 2~3 machines would make little sense as you should target to have a cluster of at minimum 4 machines (one control plane and 3 workers). We can see here that the minimum running cost for this setup would be $80 / month. So you would need to have a business that can support this level of costs at the beginning as it would lead to $960/year in running costs. And quite likely having a business that supports $960/year in revenue could probably be managed with fewer or cheaper machines.

We could do some similar calculations for AWS and using the t3.small machines that would work out to about $860/year (Note that t3.small have 2 GB RAM vs 4 GB RAM) which is the reason the pricing is cheaper in the AWS case.

Deploying a system using Kubernetes sets the floor of the minimum number of machines and their specs for the platform. I would recommend that people designing their infrastructure consider if the business they are deploying with would benefit with the scalability of Kubernetes. You would be quite surprised to see how well a single standalone machine can be used to start off a business and be vertically scaled or split out to multiple machine and managed with ansible/puppet and some terraform.

First steps with Kubernetes – learn it on a local machine

The cheapest way to learn Kubernetes would be to start experimenting with it on your local computer. Just learning to setup Kubernetes would take a considerable amount of time figuring out the proper build steps and scripting the initialization of the hosts before getting them to connect them together.

Depending on the cloud provider there might be additional configuration needed, things like creating the VPC, subnets, internet gateways and more before getting something working (and that could take some considerable trial and error). A real quick way to see that you have things working for your Kubernetes setup would be to use Vagrant to launch a fleet of virtual machines (most modern hardware should be able to launch 2~3 machines with ease) and see that you have the initialization working through a cloud init script that kicks off Puppet or run ansible playbooks once the machines have come online.

Learning Kubernetes takes time to learn and we hope this provides a high level overview of my thoughts on when it would be useful and how to get started. I hope this gives a jumping off point for when Kubernetes can be a useful tool!