Cost comparison on Managed Kubernetes (2020)

Note. transl.: American DevOps engineer Sid Palas, using recent announcement of Google Cloud as an informational occasion, I compared the cost of the Managed Kubernetes service (in different configurations) from the world's leading cloud providers. An additional advantage of his work was the publication of the corresponding Jupyter Notebook, which allows (with minimal knowledge of Python) to adjust the calculations to fit your needs.

TL; DRA: Azure and Digital Ocean do not charge for the compute resources used for the control plane, making them a good choice for deploying many small clusters. To run a small number of large clusters, GKE is best suited. In addition, you can significantly reduce costs by using spot/preemptive/low priority nodes or by β€œsubscribing” to the same nodes for a long time (this applies to all platforms).

Cost comparison on Managed Kubernetes (2020)
Cluster size (number of workers)

Overview

Recent Google Cloud announcement about the beginning of charging 10 cents per hour for each cluster in GKE prompted me to start analyzing the prices of the main offerings in the managed Kubernetes area.

Cost comparison on Managed Kubernetes (2020)
This announcement has greatly upset some...

The main characters of the article are:

Breakdown of expenses

The total cost of running Kubernetes on each of these platforms is made up of the following components:

  • Cluster management fee;
  • Load balancing (for Ingress);
  • Computing resources (vCPU and memory) of workers;
  • Egress traffic;
  • Persistent storage;
  • Data processing by the load balancer.

In addition, cloud providers offer significant discounts if the client wants / can use preemptible, spot or low-priority (low-priority) nodes OR undertakes to use the same nodes for 1-3 years.

It is worth emphasizing that while cost is a good basis for comparing and evaluating service providers, there are other factors to consider:

  • Uptime (Service Level Agreement);
  • the surrounding cloud ecosystem;
  • Available versions of K8s;
  • Quality of documentation/tools.

However, these factors are beyond the scope of this article/study. IN February post on the StackRox blog non-price factors for EKS, AKS and GKE are discussed in detail.

Jupyter Notebook

To make it easier to find the best solution, I have developed jupyter notebook, using plotly + ipywidgets in it. It allows you to compare provider offerings for different cluster sizes and service sets.

You can practice with a live version of the notebook in Binder:

Cost comparison on Managed Kubernetes (2020)
managed-kubernetes-price-exploration.ipynb on mybinder.org

Let me know if the calculations or the original pricing are incorrect (this can be done via an issue or pull request on GitHub - here is the repository).

Conclusions

Alas, there are too many nuances to give more specific recommendations than those included in the TL;DR paragraph at the very beginning. However, some conclusions can still be drawn:

  • Unlike GKE and EKS, AKS and Digital Ocean do not charge for control layer resources. AKS and DO are more profitable if the architecture includes many small clusters (for example, one cluster per each developer or each client).
  • The slightly less expensive computational resources of GKE make it more profitable as cluster sizes increase*.
  • The use of preemptive nodes or long-term binding to nodes can reduce costs by more than 50%. Note: Digital Ocean has no such discounts.
  • Google charges higher for outbound traffic, but the cost of computing resources is the determining factor in the calculation (unless your cluster is a source of a significant amount of outbound data).
  • Selecting machine types based on CPU and memory workload needs will help you avoid overpaying for unclaimed resources.
  • Digital Ocean charges less for vCPUs and more for memory compared to other platforms, which can be a deciding factor for some types of compute workloads.

*Note: Analysis uses data for general purpose computing nodes (general purpose). These are n1 GCP Compute Engine instances, m5 AWS ec2, Azure D2v3 VMs, and DO droplets with dedicated CPUs. In turn, you can also conduct research among other types of virtual machines (burstable, entry-level). At first glance, the cost of virtual machines depends linearly on the number of vCPUs and the amount of memory, however, I am not sure that this assumption will remain true for highly non-standard memory / CPU ratios.

Article The Ultimate Kubernetes Cost Guide: AWS vs GCP vs Azure vs Digital Oceanpublished in 2018 used a reference cluster with 100 vCPU cores and 400 GB of memory. For comparison, according to my calculations, a similar cluster on each of these platforms (for on-demand instances) will cost the following amount:

  • AKS: 51465 USD/year
  • EKS: 43138 USD/year
  • GKE: 30870 USD/year
  • DO: 36131 USD/year

I hope this article, along with the notebook, will help you evaluate the main offers of managed Kubernetes and / or save on cloud infrastructure by taking advantage of discounts and other opportunities.

PS from translator

Read also on our blog:

Source: habr.com

Add a comment