Skip to content

Kubernetes Pros and Cons

homepage-banner

Introduction

Kubernetes is an open-source container orchestration system that automates the deployment, scaling, and management of containerized applications. It has gained popularity in recent years due to its ability to simplify the management of complex containerized applications. However, like any technology, it has its advantages and disadvantages that should be considered before deciding whether to use it.

Pros of Kubernetes

Automated Operations

If you configure your deployment correctly, Kubernetes can automate various aspects of it. Processes running on the node will restart containers that crash, while liveness and readiness probes monitor the container’s health and ability to serve live traffic. You can configure pod auto-scalers on your deployments to automatically increase the number of replicas based on metrics such as CPU utilization.

High Scale

Regardless of the size of your application, it is important to consider how it will scale. Whether you are deploying a large enterprise application or a small startup, you will need a scalable solution that can grow with your needs. Waiting until you need to scale is not the time to start thinking about how you will do so!

A Workload Abstraction

In comparison, Kubernetes provides a workload-level abstraction. This means that you describe your application in terms of workloads. For example, you could have a server that needs to run in a distributed fashion, a database that requires certain disk volumes to be attached, a logging utility that needs to run on every node, or a movie to render one frame at a time on the cheapest resources available. All of these deployment constructs and more can be natively represented in Kubernetes.

Declarative Configuration

Kubernetes adopts a declarative resource model, where you define your workload using configuration files (usually in YAML format), and the system strives to implement your configuration as a reality. For example, if you specify that you need three replicas (copies) of your application with a load balancer to connect them to the outside world in a Deployment, Kubernetes will allocate space in your cluster to run those three replicas and attach a load balancer. Kubernetes not only creates these replicas initially but also continuously monitors them and tries to keep them running in case of a crash or failure.

Cost Efficiency

Kubernetes simplifies the management of the lowest-level compute building blocks, which are virtual machines. In the past, you may have assigned one app per virtual machine for maintenance reasons. However, Kubernetes enables you to efficiently host multiple instances of one or more apps on a single machine for high efficiency, also known as bin-packing. The combination of using commodity building blocks (raw compute nodes) with robust orchestration of workloads often makes Kubernetes an attractive option from a price perspective.

Extensibility

If Kubernetes can’t perform a task, you can develop or obtain your own Kubernetes-style API to accomplish it. While this is not necessary for most workloads, such as stateless or stateful web applications, it can be useful for adding specific business logic or constructs that Kubernetes doesn’t support. With the Custom Resource Definition (CRD) object and operator patterns, you can create your own Kubernetes-style APIs.

Open Source

Kubernetes is an open-source platform available on all major clouds as a managed offering.

Customized Workflows

Kubernetes offers significant flexibility in this area, which can be especially advantageous for larger teams. Companies with central core platform teams often create opinionated pipelines for their application developer (app dev) teams to use. These pipelines can ensure that certain development practices, such as those related to security and resource usage, are followed.

Cons of Kubernetes

Complexity

If you can accurately predict the scope of your current and future business requirements, and do not require the flexibility that Kubernetes offers, or the vendor portability of the Kubernetes ecosystem, and your application architecture neatly fits into the expectations of a more specialized platform, then go ahead and use it!

Managed service

I do not recommend using Kubernetes for deploying software if fully-managed equivalents are available. For instance, it makes little sense to run a SQL database in Kubernetes when your cloud provider can handle it for you. Although there are some exceptions where self-management becomes desirable, in general, I believe in using managed services whenever possible.

Reference

  • William Denniss - Kubernetes for Developers (2023)
Leave a message