Into the DevOps — Kubernetes

What is Kubernetes?

In the World full of Automation, everything is being automated, be it software, mechanical or any other industry. Simply put, Kubernetes is kind of an automation(management) tool for the IT industry or mainly the DevOps world.

The DevOps world, mostly contain of Docker and Kubernetes. While Docker is a tool to run/launch OS(known as containers in Docker Terminology) within split seconds, Kubernetes is used to orchestrate these Containers. Kubernetes is used to manage, scale and orchestrate the containers with very efficient way.

fun fact: Kubernetes is also known as k8s

The need of Kubernetes

The boom of Docker was in the year 2013, but as developers were using the Docker very extensively the no. of containers were increasing as per their usage. But as the scale was very large, it was very complicated to manage and scale the applications inside the containers.

So, Google was the first company which was planning to develop something to manage the Docker Containers. Internally, they were working on this project for years, but finally in 2014, they released and open sourced Kubernetes for the world. Since then, it was very easy to manage and scale the applications running on containers and Developers across the world were very much overwhelmed with this tool.

Characteristics of k8s

Modern applications are increasingly based on the use of containers, which are packaged microservices with their dependencies and configurations. Kubernetes is an open source software to implement and manage those containers on a large scale. It enables any number of servers of many types at the same time, separated by distance, to share workloads for a common tenant.

Most importantly, Kubernetes was designed to be used anywhere, so it can orchestrate on-site, public cloud and hybrid deployments. With Kubernetes, concrete steps can be taken to achieve better IT security. In addition, it must also be integrated with networking, storage, security, telemetry and other services to provide a comprehensive container infrastructure. This offers the simplicity of Platforms as a Service (PaaS) with the flexibility of Infrastructure as a Service (IaaS) and allows for portability between infrastructure providers.

Some of its features include:

  • The ability to automatically place containers according to your resource requirements, without affecting availability.
  • Service discovery and load balancing: no need to use an external mechanism for service discovery as Kubernetes assigns containers their own IP addresses and a unique DNS name for a set of containers and can balance the load on them.
  • Planning: it is in charge of deciding in which node each container will run according to the resources it requires and other restrictions. It mixes critical and best-effort workloads to enhance resource utilization and savings.
  • Enable storage orchestration: automatically set up the storage system as a public cloud provider. Or an on-premise networked storage system such as NFS, iSCSI, Gluster, Ceph, Cinder and others.
  • Batch execution: in addition to services, Kubernetes can manage batch and IC workloads, replacing failed containers.
  • Configuration and secret management: sensitive information such as passwords or ssh keys are stored in Kubernetes hidden in ‘secrets’. Both the application’s configuration and secrets are deployed and updated without having to rebuild the image or expose sensitive information.
  • Self-repair: restart failed containers, replace and re-program them when nodes die. Also remove unresponsive containers and do not publish them until they are ready.
  • Execution of automated deployments where changes to the application or its configuration are progressively implemented, while its status is monitored. This ensures that you do not delete all your instances at once. If something goes wrong, Kubernetes will reverse the change.

Capabilities of k8s

  • Multi-cloud flexibility: As more enterprises run on multi-cloud platforms, they benefit from Kubernetes, as it easily runs any application on any public cloud service or a combination of public and private clouds.
  • Faster time to market: Because Kubernetes can help the development team break down into smaller units to focus on single, targeted, smaller micro-services, these smaller teams tend to be more agile.
  • IT cost optimization: Kubernetes can help a company reduce infrastructure costs quite dramatically if it is operating on a large scale.
  • Improved scalability and availability: Kubernetes serves as a critical management system that can scale an application and its infrastructure whenever the workload increases, and reduce it as the load decreases.
  • Effective migration to the cloud: Kubernetes can handle rehosting, re-platforming and refactoring. It offers a seamless route to effectively move an application from the facility to the cloud.

Benefits and DisAdv of k8s

In summary, and having seen all the above information, Kubernetes has the following benefits for companies:

  • Using Kubernetes and its huge ecosystem can improve productivity.
  • Using Kubernetes along with good native cloud technology attracts talent. For example, many software engineers want to work in companies that use modern and interesting technologies.
  • Kubernetes is a feasible solution for many years to come.
  • Kubernetes helps an application run more stably.
  • Kubernetes can be cheaper than other alternatives, especially if you have large computing resources.

While all of these advantages sound quite attractive, not all companies are using Kubernetes, and this may be the result of an assessment of their disadvantages:

  • Kubernetes can be too much for simple applications: If you do not intend to develop something complex for a large audience, or do not have large computing resources, you do not take full advantage of this technology.
  • Kubernetes is very complex and can reduce productivity: Kubernetes is known for its complexity. Especially for developers who are not familiar with infrastructure technologies, it can be very difficult to work with them.
  • The transition to Kubernetes can be cumbersome: If you have software and want to adapt it to Kubernetes, it must take time to run smoothly, which is difficult to estimate.
  • Kubernetes can be more expensive than other alternatives: This is because all of the above disadvantages cost engineers time that is not spent creating new “tangible” business value.

The power of Kubernetes — Use Cases

1. Learning Kubernetes by deploying a simple app

The first case where you can make use of Kubernetes may seem controversial, but still is very useful. Let’s assume that we have a simple three-tier application with backend written in Python/PHP, a database and front-end created in React or Angular. To deploy it, you can use Kubernetes. Yes, from a purely practical point of view this would be not very reasonable: Kubernetes is complex and creating a Kubernetes cluster to run one simple app would mean doing unnecessary work. Further, you can deploy such an app using other, less expensive solutions. But there is an educational purpose that shouldn’t be overlooked. In undertaking such a deployment, you will learn how to run a Kubernetes cluster and deploy applications on it.

2. Microservices architecture

A use case where you want to deploy a more complicated app with many components that will communicate with one another is a classic scenario for Kubernetes. In fact, its origins go back to Google deploying, managing and scaling apps in a more efficient way by using containers. That’s how the container orchestration platform Kubernetes was born. So, we now have a K8s cluster with one complicated app deployed. This app has numerous components that communicate with one another. Kubernetes helps you manage this communication.

This is closely related with another important trend in software development: microservice architecture, which I’ll explain using the example of an Internet bookstore. In such a store, we have different functionalities: manage users, order books, manage order lists, etc. There can be many such functionalities and each of them is a separate app. This is a practical realization which are aptly called microservices. All these apps must communicate with each other. To enable such communication and coordination, code must be written to conform with the programming language of each component.

Here you can clearly see the power of Kubernetes in managing microservices. It handles for developers such tasks as detecting problems with communication between the intra-app components, managing the behavior of components in the event of a failure or managing the authentication processes between components. What’s more, as more or less resources are needed for a particular component, Kubernetes automatically scales them up or down. This is a clear advantage of the microservice architecture: scalability. You can scale a single component rather than the whole app.

3. Lift and shift — from servers to cloud

This scenario occurs frequently today, as software is migrated from on-prem infrastructure to cloud solutions. Let’s imagine the following situation. We have an application deployed on physical servers in a classical data center. For practical or economic reasons, it has been decided to move it to the cloud: either to a Virtual Machine or to big pods in Kubernetes. Of course, moving it to big pods in K8s isn’t a cloud native approach, but it can be treated as an intermediary phase. First, such a big app working outside the cloud is moved to the same big app in Kubernetes. It is then split into smaller components to become a regular cloud native-app. Such methodology is called “lift and shift” and is a good use case where Kubernetes can be used effectively.

4. CI/CD — software development lifecycle

Kubernetes also brings considerable benefits to Continuous Integration/Continuous Deployment or Continuous Delivery methodology. Once an app is deployed into operations, how it works must be monitored constantly. That’s in addition to gathering users’ feedback and developing new features. Whether it’s for testing, frequent releases or deploying newer versions of an app, Kubernetes makes everything simpler and more manageable.

and many more….

Conclusions:

We learnt what is Kubernetes and the need of kubernetes in this IT world.

We have clearly seen what can we achieve with the help of Kubernetes, benefits and when not to use k8s, in this brief article.

““ Keep learning and keep sharing ””