Azure aks Azure Kubernetes具有虚拟节点和自动缩放功能-这可能吗?
我已经成功部署了带有虚拟节点的AKS,它会自动创建Azure容器实例以支持请求的POD数量,并且我可以通过以下方式手动扩展:Azure aks Azure Kubernetes具有虚拟节点和自动缩放功能-这可能吗?,azure-aks,Azure Aks,我已经成功部署了带有虚拟节点的AKS,它会自动创建Azure容器实例以支持请求的POD数量,并且我可以通过以下方式手动扩展: kubectl scale --replicas=20 deployment.apps/blah 果然,我看到在一个特殊的资源组中创建了20个容器实例,它们都在运行我的应用程序。当我缩小它时,它们就消失了。这太棒了 然后我尝试设置自动缩放。我在yaml中设置CPU的限制/请求,我说: kubectl autoscale deployment blah --min=1 -
kubectl scale --replicas=20 deployment.apps/blah
果然,我看到在一个特殊的资源组中创建了20个容器实例,它们都在运行我的应用程序。当我缩小它时,它们就消失了。这太棒了
然后我尝试设置自动缩放。我在yaml中设置CPU的限制/请求,我说:
kubectl autoscale deployment blah --min=1 --max=20 --cpu-percent=50
但是没有新的豆荚被创造出来。要了解更多信息,我建议:
kubectl describe hpa
我得到:
Type Status Reason Message
---- ------ ------ -------
AbleToScale True SucceededGetScale the HPA controller was able to get the target's current scale
ScalingActive False FailedGetResourceMetric the HPA was unable to compute the replica count: unable to get metrics for resource cpu: no metrics returned from resource metrics API
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedGetResourceMetric 3s (x12 over 2m49s) horizontal-pod-autoscaler unable to get metrics for resource cpu: no metrics returned from resource metrics API
Warning FailedComputeMetricsReplicas 3s (x12 over 2m49s) horizontal-pod-autoscaler failed to get cpu utilization: unable to get metrics for resource cpu: no metrics returned from resource metrics API
自1.8版起,metrics服务器
在AKS中自动可用(我的是1.12版,新创建的)
这是否特别是虚拟节点的问题,即它们是否缺乏通过
metrics server
以autoscale
所要求的方式公开资源利用率的能力?或者我还需要设置其他内容吗?Metric Server应该能够从虚拟Kubelet(ACI)收集指标
下面是一个回购的例子,表明HPA和ACI是可能的