简体   繁体   中英

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

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?ie 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?)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM