Kubernetes is the Answer! But what was the question?
📣 Kubernetes is the answer!
😕 But what was the question?
Context: Application containerization
Application containerization is the answer to reducing friction between development and production. It allows software engineering teams to quickly push high-impact features with minimum downtime.
Containers are essentially a language-neutral way to pack an application with all its dependencies. In the end, it avoids (reduces?) the “works on my machine, but broken in production” issue.
Problem: Container orchestration
As your business grows, you will want to run your containers on several Nodes, either Virtual Machines or Physical Servers. Why?
- Horizontal scaling: At some point you can no longer add capacity to your application by “buying a bigger server”. You need to “buy more servers” instead.
- Redundancy: Servers break. Suffering an outage because one server failed is no longer an excuse for application downtime.
- Right Nodes to right containers: Some containers (e.g., databases) will benefit from Nodes with local NVMe. Others (e.g., in-memory caches) will benefit from Nodes with high memory. By using several Nodes, you avoid having to settle on one Node which is either underutilized or slow for at least one container.
Now that you decided to run your containers on several Nodes, you need to figure out:
- Scheduling: How do I to put the right container on the right Node?
- Networking: How do I create an internal network to allow containers to communicate?
- Service discovery: How do I create something like an “internal DNS” to allow upstream containers to find the IP address of downstream containers?
- Storage: How do I attach a Volume to the right Node, then the right container on that Node?
- Ingress: How do I get traffic into the right Node, then into the right container?
- Self-healing: What do I do if a container crashes? Or a Node goes down?
- Updates: How do I perform rolling updates to ensure updates with zero downtime?
- etc.
Solution: Open source, open governance
To solve these problems you need a container orchestration engine. You have quite a few options:
- DIY (Do It Yourself)
- Docker Swarm
- Nomad
- Proprietary solutions (e.g., AWS Fargate or Serverless)
- Kubernetes
While all solutions above can fit the bill, Kubernetes stands out due to the following reasons:
- Open source, i.e., no licence costs.
- Open governance, i.e., no single vendor can derail the project.
- Popular, i.e., adopted by many organizations.
- Extensible, i.e., the Kubernetes API can be extended with CustomResourceDefinitions, webhooks, etc.
- Surrounded by huge ecosystem: Intrusion detection? There’s a project for that! API Gateways? There’s a project for that! Monitoring? There’s a project for that!
- Battle-tested and production-ready