The MaiA project codebase is in active development, and the team has finally achieved a continuous integration and continuous deployment workflow. We encountered situations that required the streamlining and automation of some of the frequent, repetitive processes of service updates, scaling, deployment to specific servers (development or stage or production), health checks, monitoring, and so on. We need technology that helps our DevOps team and offers the best features in the industry. The solution is Kubernetes(K8s).
This series of blog posts captures our learning path for Kubernetes, and we consolidate everything that is needed for you to get started with Kubernetes. We hope people who are reading this have a basic understanding of cloud infrastructure and are familiar with working with web services.
Let’s get started!
Kubernetes (shortened to K8s) is a tool that allows you to run and manage containerized applications across a cluster of machines. Kubernetes automates the deployment, scaling, and management of your applications, making it easy for you to run and maintain them. It does this by creating and managing small, lightweight containers for your applications and then running those containers across a cluster of machines. This allows you to easily scale your applications and ensure they’re running smoothly and reliably without having to manually manage each individual machine. Additionally, Kubernetes provides features such as automatic load balancing, self-healing, and automatic scaling, which help you keep your applications running smoothly and efficiently.
History of Kubernetes
Kubernetes is an open-source container orchestration system for automating the deployment, scaling, and management of containerized applications. It was originally designed by Google and is now maintained by the Cloud Native Computing Foundation (CNCF).
The Kubernetes Project was open-sourced by Google in 2014 after it had been used to run production workloads at scale for more than a decade. Kubernetes provides the ability to run dynamically scaled, containerized applications while utilizing an API for management.
Kubernetes provides a platform-agnostic way to manage containerized workloads and services, allowing you to run applications in a variety of environments, including on-premises, in the cloud, or in a hybrid environment.
What Kubernetes can do
Out of the box, K8s provides several key features that allow us to run an immutable infrastructure. Containers can be removed, replaced, and self-heal automatically, and the new container gets access to those support volumes, secrets, configurations, etc. that make it function.
These key K8s features make your containerized application scale efficiently:
- Horizontal scaling: Scale your application as needed from the command line or UI.
- Automated rollouts and rollbacks: Roll out changes that monitor the health of your application, ensuring all instances don’t fail or go down simultaneously. If something goes wrong, K8S automatically rolls back the change.
- Service discovery and load balancing: Containers get their own IP, so you can put a set of containers behind a single DNS name for load balancing.
- Storage orchestration: automatically mount local, public, or network storage.
- Secret and configuration management: Create and update secrets and configurations without rebuilding your image.
- Self-healing: The platform solves many problems: restarting failed containers, replacing and rescheduling containers as nodes exhaust, removing containers that don’t respond to your user-defined health check, and waiting to advertise containers to clients until they’re ready.
- Batch execution: Manage your batch and continuous integration workloads and replace failed containers.
- Automatic bin packing: automatically schedules containers based on resource requirements and other constraints.
What Kubernetes can’t do
Kubernetes can do a lot of useful things. But it’s just as important to consider what Kubernetes isn’t capable of:
- It does not replace tools like Jenkins, so it will not build your application for you.
- It’s not middleware, so it will not perform tasks that middleware performs, such as message bus or caching, to name a few.
- It does not care which logging solution is used. Have your app log to stdout, then you can collect the logs.
- It does not care about your configuration language, e.g., JSON.
K8s doesn’t have an opinion on these issues since we need to be able to create our apps in any methods we choose, disclose any kind of information, and gather that information however we please.
Competitors to Kubernetes
Of course, Kubernetes isn’t the only tool on the market. There are a variety of tools, including:
- Docker Compose is good for staging but not production-ready.
- Nomad allows for cluster management and scheduling, but it does not solve secret and configuration management, service discovery, or monitoring needs.
- Titus: Netflix’s open-source orchestration platform doesn’t have enough people using it in production.
Overall, Kubernetes offers the best out-of-the-box features, along with countless third-party add-ons to easily extend its functionality.
That sums up the basic introduction. We will be discussing the architecture and terms related to Kubernetes orchestration in our next post.
Stay Tuned!