I have few independent spring boot REST API microservices sharing a common database. I'm new to devops and I'm quite confused about load balancing scaling etc. I just want depending on traffic volume the microservice which is getting the majority traffic should scale or launch multiple instances of it to distribute load and as traffic lowers it should scale down automatically
. Please suggest me a way to do so. You can give me any docs or article so that I learn about this things; because kubernetes, kubectl, containers and pods these terms are going over my head.
CodePudding user response:
it would be best if you used the built-in Kind
called Horizontal Pod Autoscaling
, or HPA
.
it's basically a set of configuration rules, that scale up or scale down your application, based on the configuration you want, the most common rule is scaling based on CPU or MEMORY usage (if the pods get more requests, the pod use more CPU, but it's not the case all the time), you can read more about that in the docs.
if you want to scale tour application based on more complex metrics, you can use tools like keda,