Do I really need Kubernetes?

The original text was published in the kubernetes Chinese community , the original translation for the author, the original address

For more kubernetes articles, please follow kubernetes Chinese community

table of Contents

What will Kubernetes do?

Improve single application

Enhanced monolithic application

No more monolithic applications

in conclusion


If you follow technology news, then Kubernetes seems to be everywhere. It has become very popular. In fact, without using Kubernetes, developers and DevOps teams may feel that their application development pipeline is outdated.

Kubernetes is an orchestration tool for containerized applications. Starting with Docker containers, Kubernetes can control the resource allocation and traffic management of cloud applications and microservices.

In this way, Kubernetes simplifies many aspects of service-oriented application infrastructure. In addition to continuous integration and continuous deployment (CI/CD), Kubernetes also provides the infrastructure to scale these applications without a lot of work.

There are many exciting things to use Kubernetes to manage cloud and hybrid cloud environments. However, many teams often catch up with hot spots and migrate to Kubernetes prematurely, often resulting in a lot of time, money wasted, and developer frustration.

In this article, we will try and help you answer the following questions: Do I really need Kubernetes?

What will Kubernetes do?

Kubernetes is an orchestration tool for containerized applications. It is responsible for:

  • Deploy images and containers
  • Manage the expansion of containers and clusters
  • Resource management of containers and clusters
  • Service traffic management

When your application consists of multiple services running in different containers, Kubernetes does bring many benefits. For monolithic applications with static user groups, this may be more than necessary.

The tasks of building, testing, and delivering applications to container warehouses are not part of Kubernetes. These tasks can be done using CI/CD tools. In addition to the CI/CD pipeline , Kubernetes can also help you deploy applications to the production environment without causing service downtime.

Improve single application

Most applications start as a monolith - putting the entire application in one place, changes can be made and deployed quickly and easily. However, if your application grows, you need to find a way to scale up quickly.

Does this mean it's time for Kubernetes? maybe not.

Often, extensions are more about the internals of the application rather than the high-level architecture and tools. For example, you can expand the whole by deploying multiple instances using a load balancer that supports similarity tags.

The first step to consider when expanding an application is test-driven development (TDD), which can ensure software quality and prevent problems as the application grows. Although smaller modules or services are easier to test, modularity also means increased demand for mocking and additional tools for configuration and maintenance. Good testing allows you to build and extend applications easily and confidently.

When you start to expand the whole, configuration management tools such as Chef and Ansible will come in handy. You can use them to automatically configure new servers to ensure they are ready to run your application. You can even go one step further and use tools like Terraform to help configure new server VMs so you don't have to create them manually.

When other parts of the application become the bottleneck (such as the database), you can also extend these parts. For example, if the database becomes a bottleneck, you can move frequently accessed data to high-performance memory data storage (such as Redis) to reduce the load on the database.

No matter which configuration management and configuration tool you use, there must be a good CI/CD pipeline. When deploying the application for the first time, you may have copied the zip file to the server via FTP, but this method cannot be extended. The simplified CI/CD pipeline ensures that your application is automatically built, tested and deployed without any additional work by you or your team.

You can even use cloud services such as AWS Elastic Beanstalk, Google App Engine, or Azure App Service to automatically scale a single application. Compared with Kubernetes, all of these bring less management overhead, and they can all work well with CI/CD tools.

When developing a new application, focus on developing the best application. Complex tools like Kubernetes may be the right solution for managing application infrastructure.

Enhanced monolithic application

As the application continues to grow, you may eventually no longer be able to add functionality to the monolithic application. This is usually because the application is close to the limit of what a single development team can do.

At this point, many teams choose to split the monolithic application and completely migrate to microservices. Although this is a popular decision, it is neither a necessary decision nor a panacea. Organizations can consider starting from adding functional services of a single application instead of replacing the single application as a whole. Some of these supporting services may actually be microservices-so you can benefit from using small services under reasonable circumstances while still taking advantage of the benefits of monolithic applications.

Even with the introduction of microservices, you may not need or want to start with Kubernetes. Kubernetes is good at running and extending Pods of related services and microservice containers. However, some aspects of adopting Kubernetes are easily overlooked. For example, Kubernetes does not have powerful built-in tools for protecting Pods, nodes, and clusters, and deploying Kubernetes clusters in a multi-cloud environment adds a lot of complexity.

Starting with single cloud platforms like Azure Service Fabric and AWS Fargate, it is easier to start and scale services without forcing you to manage Kubernetes clusters.

Another option is to completely avoid services with maintenance overhead and choose functions as a service (FaaS) , such as AWS Lambda or Azure Functions. FaaS is a great way to minimize potential infrastructure overhead when adding services to an application. In addition, if you ultimately need to use a Kubernetes orchestrated cluster, you can use FaaS to enhance it.

No more monolithic applications

Now, imagine that your monolithic application has grown so fast that you can't adopt the monolithic application approach and begin to need to migrate to the microservice architecture.

Slowly, you have a variety of services, many of which need to communicate with each other. You need to ensure that interdependent services are always up and running and visible to each other.

In addition, you sometimes need to consider running across multiple availability zones (and possibly even multiple cloud providers).

At this point, you may need a coordinator like Kubernetes. It allows you to easily define related service modules (Pods), and can automatically scale application instances and load balance between services.

In order for Kubernetes to work, organizations need to:

  • Operate several or dozens of virtual machines
  • Assign personnel to perform Kubernetes-specific configuration and maintenance
  • Automate the deployment of most similar services
  • Nothing to do with cloud (or hosting) provider

In addition, Kubernetes has built-in support for high-availability (Amazon RDS Multi-AZ) deployment, which makes it easier to improve the reliability and availability of applications.

Of course, this does bring overhead: it takes time and engineering resources to create and manage clusters, define Pods, and create containerized applications suitable for deployment to Kubernetes. However, if your application is large enough to benefit from Kubernetes, then the management overhead is worth it.

in conclusion

Kubernetes is powerful, but that doesn't mean it is the right choice for every team and every application. Like any technology, it can solve certain problems. If you don't encounter the problem that Kubernetes wants to solve, it's more troublesome.

First, it is recommended to quickly publish the application using simple and available tools. When your application reaches its deployment and expansion as part of its own operation, it is necessary to start thinking about orchestration, and naturally use Kubernetes as an orchestration tool.

Translation link: https://thenewstack.io/do-i-really-need-kubernetes/

Guess you like

Origin blog.csdn.net/fly910905/article/details/109253937