Price Comparison of Managed Kubernetes Solutions for Web-Apps
This article provides an overview of managed kubernetes solutions to run modern web applications in a price-aware, scalable, and resilient way. It gives insights into scalability, costs, typical setup, caveats, as well additional factors to consider when choosing a provider.
The author assumes the reader has prior knowledge about software engineering, containerization, and kubernetes in particular.
What is Managed Kubernetes
Two main components of a kubernetes cluster are Control Plane and Node.
- Control Plane is responsible for controlling the cluster and its workloads.
- Node or also called “worker node” is an actual compute instance where a workload is executed.
Managed Kubernetes takes away the burden of setting up the cluster e.g. control plane and allows to focus on managing workloads and thus underlying nodes.
Typical product offering for managed kubernetes revolves around the provisioning of a control plane, as well as providing suitable machines, provisioned with the required software to become worker nodes.
Components of a Typical Web-Application
Web applications are usually the ones, that are exposed to the internet and have some sort of persistence. The minimal setup (besides an application itself!) for a simple web application would be:
- Load Balancer
- Storage
- Ingress
- Database
In the following example, traffic arrives at a load balancer, then routed to a specific node, where it is picked up by an ingress controller. The ingress controller routes traffic to a specific service. As for persistence, there is a database, and persistent storage, which is shared between application instances.
Managed Kubernetes Price Comparison
The author of this article is located in Europe, therefore some of the solutions would be focused on the local offering.
Evaluation Setup
For this example, we would be using 3x worker nodes with the following configuration: 2 vCPU and 4GB of RAM, with 50GB of disk per worker node (where applicable).
Comparison Table
The total Price is in EUR including 19% VAT. Columns “node”, “node disk”, and “LB” (load balancer) are taken from the pricing pages of respective providers and with exception of Scaleway are in USD without VAT.
Managed Kubernetes Pricing Comparison Results
Google Cloud (GCP)
Has the most expensive and the cheapest options at the same time. Despite sustained use discounts (30%), the free control plane (for one zone), as well as usage of discounted cluster location (europe-north-1) the price cheap N1 and E2 tiers, are almost the same.
The boot disk is also not free and defaults to 100GB / node or 10 EUR per month during provisioning.
Interestingly enough GCP offers a free-tier control plane and a free LB for one zone, the second would cost around ~70 EUR / month.
GCP also has a cheap option with Spot (Preemptible) VMs, which are significantly cheaper than normal compute instances. They can be used for fault-tolerant workloads and/or in highly-available environments.
Digital Ocean
This provider offers nodes with a disk, included in its price. A Load balancer price is extra and would cost at least ~12 EUR/ month.
Scaleway
The only provider with EUR prices (thus no adjustment for conversion rate in the table). The load balancer price is higher than the competition, also an extra payment for a disk is needed.
Civo and Vultr
Very similar offers, but Civo claims to have dedicated CPUs, while Vultr does not state CPU class on the main pricing page.
Amazon (AWS)
Amazon control plane for Kubernetes is not free and costs >70 EUR per month. Due to this reason, it was excluded from the current comparison.
Additional Considerations
Node Size and Available Resources
In order for a worker node to run, multiple system kubernetes services have to be present on the node. These can take up to 1.5GB of RAM and up to 1 CPU.
In addition to that, each node has to have monitoring (kube-state-metrics) and SSL-certificate management services enabled, which at minimum take ~0.3 CPU and 0.5GB RAM.
It makes nodes with 2vCPU and 4GB of RAM left with very few resources for the actual workloads. K3s distribution leaves a bit more resources to use.
Regional and Zonal Availability
Depending on the setup, it makes sense to pick a provider with suitable data center locations, next to the clients. For globally-available services, including APAC and MENA regions GKE or AWS could be preferred.
Persistence
Some providers come with a disk, while some do not. This disk is called a system or boot disk and is generally used only for the operation of the node, since containers have to be stateless, as well as the k8s nodes.
Persistence is achieved either by adding block storage with average prices of 0.10 EUR / GB / month or by using S3 object storage for storing file uploads.
Databases
All of the mentioned providers are offering managed database solutions. Pricing starts with standalone solutions (1 node) available at ~10 EUR/month and highly-available solutions available from ~20 EUR/month for a database.
The choice of a database as well as a provisioning model is outside of the scope of this article, but it is worth mentioning that database could be set up fairly simply using existing kubernetes resources.
K3S and K8S
k3s is a lightweight, Kubernetes distribution designed for low-resource environments. It is made by Rancher Labs.
Provider “Civo” is using k3s, and it is living up to the statement about low-resource usage. K3s leaves slightly more available resources on the nodes, compared to the default distribution.
Alternatives
This article focuses on Managed Kubernetes, while other approaches to hosting web apps exist. Depending on the use case, it is worth looking into the following alternatives options:
- Shared Hosting
- Dedicated VM
- Managed Applications
- Managed Docker
Conclusion
Kubernetes for web projects offers great flexibility, resilience, scalability, and a great number of existing solutions on the internet, at a somewhat high management overhead.
A cluster setup for this article (3 x 2vCPU, 4GB RAM) the cluster has at most 700 mCPU and 2GB of memory, due to the fact that after having a bunch of system and miscellaneous services running.
With this setup, it is possible to run a few simple applications, but not something CPU-intensive. Such setup is not cost-efficient for the performance it provides.
The cost efficiency (evaluated as simple as price per app instance) goes up with more resourceful nodes, as well as with quantity of the running apps.
Personal Choice
The author of this article uses a highly available setup of Spot-VMs from GCP with more powerful nodes (4 CPU and 8GB memory).
Usage of spot VMs allows saving on compute costs by around 50% while compensating for possible outages with the number of cluster nodes.