Kubernetes Autoscaling集装箱

是否有可能自动扩展docker容器,其中包含应用程序服务器(如wildfly / tomcat / jetty /)内kubernetes? 例如在CPU和RAM使用或基于HTTP请求? 如果有一个内置function,我找不到它,或者有可能写这样的configuration脚本的东西? 如果是这样的话,魔术会发生在哪里

集装箱的自动调节尚未得到支持,不属于近期的Kubernetes 1.0路线图 (即核心团队不会很快join,但外部贡献肯定受到欢迎)。

您可以在kubernetes 1.3以上使用水平吊舱自动缩放。 kubernetes博客提供了有关function的详细信息。

http://blog.kubernetes.io/2016/07/autoscaling-in-kubernetes.html

但上面的文章主要关注GKE。 所以下面会提供更多的信息。

https://kubernetes.io/docs/user-guide/horizo​​ntal-pod-autoscaling/

这里描述了如何使用kubectl进行pod自动调节。

kubectl autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU] [flags] 

例子

 # Auto scale a deployment "foo", with the number of pods between 2 and 10, target CPU utilization specified so a default autoscaling policy will be used: kubectl autoscale deployment foo --min=2 --max=10 # Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80%: kubectl autoscale rc foo --max=5 --cpu-percent=80 

由于Kubernetes 1.2自动缩放是稳定的API的一部分。 它是基于CPU使用率或基于容器本身提供的指标来完成的。

它可以用于像这样的部署或复制控制器:

 # Auto scale a deployment "foo", with the number of pods between 2 and 10, target CPU utilization specified so a default autoscaling policy will be used: kubectl autoscale deployment foo --min=2 --max=10 # Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80%: kubectl autoscale rc foo --max=5 --cpu-percent=80 

进一步的细节可以在官方文档的横向扩展描述中,在kubectl autoscale文档和官方博客中find 。