Oct 26 2020

Spring Boot + Kubernetes = Love (or something like that)

Category: MiscellaneousIuliana @ 22:31

In the previous entry I had a Spring Boot application running in a Docker container. And that is good. But an application designed to be used by a lot of users should be scalable. Well… not the app per-se, but the setup managing it. So, I have a container with an application running. What if more users access it than the poor container with its limited resources can handle? Well, in this case, I need another container with the same application installed and a component called a load balancer that will direct traffic as needed. This is where Kubernetes comes in handy.

Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. This means, now that I have an image of my containerized application, I can use Kubernetes to deploy it on more than one container and I can use it to manage my containers. I can decide the resources assigned to a container and I can tell Kubernetes how many containers I want for crowded and lighter situations. Kubernetes can do a lot for me, but I will focus here on something called Horizontal Pod Autoscaler – you can configure one of these to manage a number of containers. As the name of this components says it quite clearly, I can configure it to automatically decide the number of container with my application that need to be up and running based on a specific criterion. And because it is the easiest for me to do, my criteria will be the CPU load percentage. (instead of users requests)
Continue reading “Spring Boot + Kubernetes = Love (or something like that)”

Tags: , , , , ,