Kubernetes — What Is It, What Problems Does It Solve and How Does It Compare With Alternatives?

  • What is Kubernetes?
  • What problems does it aim to solve?
  • When should you choose to use Kubernetes? What alternatives are available?
  • What is the architecture of Kubernetes?
  • How one can use Kubernetes (with a simple example).

Background of Software Applications in the Early Days

The disruptive new millennium

The rise of cloud

Development and Deployment Issues Remain Unsolved

  • Large build times. Extremely large code bases resulted in large build times, i.e, large downtime for deployment. But high availability has been a critical requirement, and downtime was unacceptable.
  • Slow Development. Another big problem with a large code-base, is its effect on development speed. Since the entire code-base is encompassed in a single instance, a broken code from one single developer in the team, could block the work of a hundred other developers from being deployed. In the early 2000s, the Agile software development method emerged, which advocated evolutionary development, early delivery, and continual improvement. But monolithic style discouraged the developers from making small incremental changes, as the cost of a new deployment was very high.
  • Poor resilience to failures. A monolithic web application handles application failures very poorly. In a monolithic application, all the business functionality is handled by a single instance. A fatal error in performing a single business function, could bring down the entire application. Instead of the entire business functionality being unavailable, we would prefer a scenario where the well-functioning part of the application remained available without interruption, while the error-prone functionality is fixed.
  • Low resource utilization. When the work load to perform a particular business function suddenly increases, the entirety of a monolithic application has to be scaled, to balance the workload. This results in sub-optimal consumption of computing resources. In a world of cloud, redundant usage of resources costs money. Instead, one would prefer a scenario where only a small part of the application, necessary to handle the required business function scales, resulted in optimum utilization of resources.

Microservices

  • Only a small service has to be rebuilt whenever the code is updated, thus reducing the deployment time. The reduction in deployment time encourages continuous delivery and deployment.
  • The decomposition also results in the application becoming more resilient to failures, as downtime is observed only for the error-prone services, while other services remain fully functional.
  • Workload fluctuations could be handled much more efficiently. Optimum utilization of cloud resources is possible, if the number of replicas of a service is dynamically adjusted per workload.

New Challenges

  • Redundant usage of cloud resources. As mentioned earlier, in Microservices, dynamically scaling the replicas of a service is essential for optimum utilization of cloud resources. This would require fine-tuned control over how cloud resources are being utilized. In Microservices architecture there are too many moving parts. Manually controlling the usage of all the cloud resources is not feasible. So, the new challenge is to design a solution that controls the utilization of cloud resources at a fine-tuned level.
  • The nightmare of deployment operations. In Microservices, we’re splitting a single application into multiple smaller applications. Care must be taken to ensure that communication between the services is efficient and stable, and the OS of the host has all the required dependencies before deployment.
  • The system now has multiple smaller applications instead of one. Because of this, the approach required for monitoring the overall application should be modified to handle a large number of smaller applications. Making the whole process much more complex.
  • This complexity quickly grows with the number of services, and it isn’t an exaggeration to say that the task of executing the deployment operations becomes a nightmare. A robust solution to better handle the complexity of deployment operations has become indispensable.

Innovation for New Challenges

What is a container

Why Is Containerization of Applications Important for Deployment?

  • Decoupling of application and infrastructure. Traditionally, software applications were deployed directly onto the host machine. This had the disadvantage of entangling the application’s executables, configuration, libraries, and lifecycles with each other and with the host OS. But this new approach to package each application and its dependencies into a self sufficient isolated container, makes the application completely decoupled from the host OS and infrastructure. It allows for the deployment of an application on any host, without first worrying if the host has all the dependencies installed.
  • Isolation of resources. Aside from decoupling an application from the host, an even more important advantage with containerization is the isolation of resources. If multiple containers are running on a host, a fatal error inside one container can’t affect other containers, or the host.
  • Compared to this, when all the applications are directly installed on the host, a fatal error can bring down, or corrupt, other applications, and in some cases could crash the entire host. But there is no scope for such a scenario if the applications are deployed in containers. Containerization of applications adds great value, and will simplify a great deal of complexity involved in developing, deploying, and maintaining distributed applications.
  • It wasn’t long before various engineering teams across the industry realized the advantages with containerization of applications, and decided that every application that gets deployed within their organization must be containerized.

Container Orchestration System

  • Applications which handle large scale complex operations must be highly available without any downtime.
  • Applications should be resilient to large fluctuations in workload.
  • Failure to optimally utilize the cloud resource will result in large costs.
  • Reliably performing deployment operations, to support evolutionary development, is crucial.

What is Kubernetes?

  • Kubernetes can run containerized applications of any scale without any downtime.
  • Kubernetes can self-heal containerized applications, making them resilient to unexpected failures.
  • Kubernetes can auto-scale containerized applications as per the workload, and ensure optimal utilization of cloud resources.
  • Kubernetes greatly simplifies the process of deployment operations. With Kubernetes, however complex an operation is, it could be performed reliably by executing a couple of commands, at most.

What Problems Does Kubernetes Aim to Solve?

  • Service discovery and load balancing. You have an application comprising of hundreds of Microservices, and they need to efficiently and reliably communicate with each other. Kubernetes can take care of that.
  • Horizontal scaling. The workload on your application is known to surge abruptly. Scaling up the replicas of a service will balance your workload. Scaling it down after the surge keeps your costs low. Kubernetes can do that for you (auto scale).
  • Self healing. Whenever one of the hundreds of services goes down due to fatal error, you’ll want to automatically instantiate a new, healthy replica of this service. Kubernetes can do this for you (self healing).
  • Automated rollouts and rollbacks. Kubernetes can take care of deployment operations like the rollout of a new version of the application, and the rollback to a previous version. All of these operations can be performed reliably just by executing a couple of commands from a command line.
  • Secret and configuration management. Kubernetes provides built-in mechanisms to effectively store and manage configuration (like environmental variables, database connections) across different environments (eg : production, test, development). It also allows for storing sensitive configuration data, meant to be kept secret in a special manner, so that accidental exposure of such data is minimized.
  • Storage orchestration. Kubernetes allows for effective management of storage required by an application. In Kubernetes, storage management is separated into multiple steps. The allocated storage is first configured, then a claim is made whenever an application in the cluster requires this storage. Kubernetes provides excellent integration with various storage solutions supported by cloud providers.

Tasks Unrelated to Core Functionality

  • Kubernetes doesn’t deploy source code or build the application. Continuous integration, delivery, and deployment (CI/CD) workflows are not a core feature of Kubernetes. Automation tools like Jenkins, which has excellent integration with Kubernetes, could be used for such tasks.
  • Kubernetes does not provide application-level services, such as message buses, data processing frameworks, databases, caches and storage systems as built-in services. These components can run on Kubernetes, and/or can be accessed by applications running on Kubernetes through portable mechanisms, such as the Open Service Broker.
  • Kubernetes does not dictate logging, monitoring, or alerting solutions. Although Kubernetes comes with some integrations as proof of concept, and mechanisms to collect and export metrics, using external tools that are best suited for your particular use is recommended. Fluentd is a good choice for handling logging. Prometheus is a popular choice for monitoring and altering. Helm and Envoy are also popular projects, which work well with Kubernetes and simplify the workflow. The page Projects under CNCF is a good place to find more.

Caveats With Kubernetes

When to Use Kubernetes and Alternatives

Netflix OSS and Spring Cloud

Docker Swarm

Marathon on Apache Mesos

Summary

Srikan

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Bossplayers CTF - Walkthrough

Terraform- A requisite for DevOps Spectrum

Upgrade Rails 6.1 Application to Hotwire

TemplateMonster Review

Day 21–101 Days of DevOps — Boto3 script to check if VPC Flowlog is enabled

How to Create Calling a Complex Function from Visual Studio to Wolfram Mathematica

Android Multi Language Support Tutorial With Example

Part 1 —  Getting started on AMQP using IBM MQ

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jainrishabh

Jainrishabh

More from Medium

Bachelor of Health Sciences — BHSc

OTT broadcasting: basic parameters and setup tips

7 tips on How to Fight with HONOUR — Livecast

how to fight with HONOUR

Relegation Confirmed