简体   繁体   English

Autoscale Docker Swarm服务

[英]Autoscale Docker Swarm Services

We are using Ansible along with AWS Autoscaling Groups to scale our docker swarm cluster. 我们使用Ansible和AWS Autoscaling Groups来扩展我们的docker swarm集群。 Right now this is working because we run the services in global mode so we automatically get one of each container type per docker node. 现在这是有效的,因为我们在全局模式下运行服务,所以我们自动获得每个docker节点的每个容器类型之一。 However this is not very efficient because we end up with more containers of some services than we need. 然而,这并不是非常有效,因为我们最终会得到比我们需要的更多容器。

Is anyone doing something similar but having docker swarm scale out specific services based on their resource utilization? 是否有人做类似的事情,但有docker swarm根据资源利用率扩展特定服务? It looks like it would be possible by leveraging docker stats to figure out which containers need to scale but don't want to re-invent the wheel if there's already a good solution for this. 看起来有可能通过利用docker stats来确定哪些容器需要扩展但是如果已经有一个很好的解决方案,则不想重新发明轮子。

EDIT: not looking for how to scale the swarm cluster itself but individual services running on it. 编辑:不是在寻找如何扩展群集本身,而是在其上运行各个服务。

Take a look at kubernetes. 看看kubernetes。

Kubernetes (commonly referred to as "K8s") is an open source container cluster manager originally designed by Google. Kubernetes(通常称为“K8s”)是一个最初由Google设计的开源容器集群管理器。 It aims to provide a "platform for automating deployment, scaling, and operations of application containers across clusters of hosts". 它旨在提供“跨主机集群自动部署,扩展和操作应用程序容器的平台”。 It usually works with the Docker container tool and coordinates between a wide cluster of hosts running Docker. 它通常与Docker容器工具一起使用,并在运行Docker的大型主机集群之间进行协调。

Now lets get to the point: 现在让我们谈谈这一点:

Kubernetes Horizontal Autoscaling: Kubernetes水平自动缩放:

With Horizontal Pod Autoscaling, Kubernetes automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization (or, with alpha support, on some other, application-provided metrics). 通过Horizo​​ntal Pod Autoscaling,Kubernetes可根据观察到的CPU利用率自动调整复制控制器,部署或副本集中的pod数量(或者,在alpha支持的情况下,根据应用程序提供的其他指标)。

在此输入图像描述

More info 更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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