Quando usar Kubernetes

Three reasons not to use Kubernetes

Many teams are excited to start using Kubernetes, thanks to the features offered that favor resilience, elasticity, portability and reliability. Some developers want to gain experience with the platform to add one more skill highly demanded in its curriculum, others are technology enthusiasts and look for an opportunity to know more about it. In general, most developers today would like to work with Kubernetes at some point.

However, in what scenarios is the use of Kubernetes really justified? To answer this question, let's look at some factors to take into account when choosing when to use Kubernetes, and especially when not use it.

Kubernetes was designed to solve distributed architecture problems

As explained in official Kubernetes documentation,

“Kubernetes offers a work tool to run distributed systems in a resilient way. It takes care of scale factors and failure points for your application, offers delivery standards, and more. ”

It is not made exclusively for distributed systems, but for containerized applications. Still, it offers a number of features that facilitate the management and scale of distributed systems, such as Microservices solutions. It is also considered an orchestration system.

Automation and orchestration are different but related concepts. With automation, you increase business efficiency by reducing or replacing human interaction with IT systems. In place of people, applications are used to perform tasks and thus reduce costs, complexity and errors.

In general, automation is related to the automation of an individual task. On the other hand, orchestration makes it possible to automate processes or workflows that include several steps in different systems. After incorporating automation into processes, it is possible to orchestrate them for automatic execution.

- What is orchestration? RedHat official website

In other words, Kubernetes makes it easy to manage complex solutions that would be difficult to sustain without an appropriate orchestration system. While it is possible to implement these DevOps engineering practices “from scratch”, this is not scalable if you go from dozens to hundreds of services.

Nothing prevents monolithic solutions from being hosted on Kubernetes, however the advantages that this platform offers for distributed systems do not represent any real benefit for monolithic applications.

Kubernetes is complex

To take advantage of the features available on Kubernetes, developers and operators need to have knowledge of containers, networks, security, portability, resilience and Kubernetes itself. To properly use your workloads, you must know how each component works. To manage a cluster, you must understand its architecture, storage, API and administrative functions, which are very different from traditional virtualized environments. To expand the solution, you must know how to integrate deploy, monitoring and tracing, as Helm and Istio. Many new concepts come with the use of the platform, and your team needs to be prepared for this challenge.

The technical challenges that the platform brings to both developers and operators must be taken into account when choosing the platform. Do you have specialists available on your team or are you willing to invest in hiring and training to use Kubernetes properly?

Kubernetes is expensive for small solutions

To understand why, let's reinforce one of Kubernetes' key concepts - resilience. To take advantage of this, you need nodes that is, above the minimum amount needed to run your applications. If one of nodes fall, pods requested will be relocated nodes available. In the case of production environments, at least three nodes are recommended for resilience.

It is easy to assume that if you only have one application to host without such a high scale, this infrastructure is overkill. But even if you have ten applications or more, you need to consider whether the cost of cluster its maintenance effort is worth it.

The cost of maintaining the environment also includes operational support. The more complex the platform, the more specialized people should be involved. This may involve hiring a third party company specializing in providing support for Kubernetes, or purchasing a solution with included support services, such as Openshift.

When to choose Kubernetes

Depending on the architecture used, the number of applications involved and the degree of dependence between them, and the operational capacity of your team, it is possible to check if Kubernetes is the appropriate choice among all available technologies.

Fluxo de decisão para hospedagem de aplicações
Decision flow for application hosting

With Web Apps for Containers, you have a fully enabled production environment. From the Standard plan, SSL and monitoring features are included, and it is possible to have a secure, scaled and monitored environment with little operational effort.

If you only deal with isolated applications, or a small number of connected applications, perhaps a combination of Azure Web Apps and Azure Container Instances running on the same virtual network could be enough.

On the other hand, if you have an increasing number of containerized applications, hosting them on Kubernetes can be interesting. You can host different types of applications, such as web applications, API's and jobs recurring in a single centralized environment. Your team will be able to focus on a single platform instead of several different hosting platforms.

Now, if you deal with distributed scenarios, like microservices, then go ahead. Distributed architectures are complex, and Kubernetes was designed to facilitate their management. I can't think of any platform as complete and extensible for distributed solutions as Kubernetes.

Conclusion

  • If you are dealing with a small number of applications, with little or no dependency on each other, other hosting options like Azure Web Apps for Containers or Azure Container Instances - or a combination of them - may be simpler or more cost-effective.
  • If your team is comfortable with the concepts and use of Kubernetes, and you have an increasing number of containerized applications, it may be interesting to centralize your hosting on a single platform, such as Azure Kubernetes Service.
  • Kubernetes is a platform designed to increase performance and reduce the operational effort of distributed systems. This basically makes a complex scenario, like microservices, any less operationally complex.
  • If you don’t handle a large number of applications, don’t use distributed architecture, and don’t have experts available on your team, you will not be able to enjoy the advantages that Kubernetes offers because they were not made for you. You will end up adding unwanted accidental complexity to your solution.

If you would like to better understand the hosting options for containerized applications and in which scenarios each is appropriate, check out the article below:

Choose an Azure computing service for your application

 

Published by

Grazi Bonizi

I lead the .Net Architecture track at The Developers Conference, share code on GitHub, write on Lambda3 Medium and Blog, and participate in Meetups and PodCasts typically on DevOps, Azure, .Net, Docker / Kubernetes, and DDD

Leave a Reply