How to set auto-scaling for kubernetes (both in same node and scale out) by using Azure Pipelines?

一世执手 提交于 2019-12-24 05:49:28

问题


I would like to set auto-scaling feature in Azure Pipelines for deployment of containers with Kubernetes. How can I do that if I want to auto-scaling by below rules:

  1. depeneds on no. of messages in ServiceBus message queue
  2. it will scale inside a node first (better to set maximum pods in node as it depends on thread no.?)
  3. if reach maximum pods in a node, then it will scale out to use another node (can scale to use maximum pods of node as well?i.e. 3 pods for 1 node, 6 pods for 2 nodes without total 4/5 pods)

Finally, how to set by using Azure Pipelines? (above only set in Yaml file, right?)


回答1:


I dont think there is a way to scale based on number of message in the ServiceBus queue (at least native to kubernetes), that being said - you should use Horizontal Pod Autoscaler with Cluster Autoscaler. These are native kubernetes mechanisms to scale pods\cluster based on the load on the pods.

Its in preview with AKS: https://docs.microsoft.com/en-us/azure/aks/autoscaler

Another approach I've seen: using cronJobs. Just start your message processors every minute with cronJobs and make them scale. this is an easy approach that requires not a lot of configuration. You can drop pod autoscaler with this approach and only use cluster autoscaler, I haven't used this approach, but it looks promising.



来源:https://stackoverflow.com/questions/54359953/how-to-set-auto-scaling-for-kubernetes-both-in-same-node-and-scale-out-by-usin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!