是的,ARM模板支持AKS集群自动缩放器。您可以通过在ARM模板中定义autoscaleProfile
来配置自动缩放器。
以下是一个示例ARM模板的代码片段,演示如何配置AKS集群的自动缩放器:
{
"type": "Microsoft.ContainerService/managedClusters",
"name": "",
"apiVersion": "2021-07-01",
"location": "",
"properties": {
"kubernetesVersion": "",
"autoScaleProfile": {
"enabled": true,
"minNodeCount": 1,
"maxNodeCount": 5,
"profiles": [
{
"name": "default",
"capacity": {
"min": 1,
"max": 10,
"default": 1
},
"rules": [
{
"metricTrigger": {
"metricName": "cpuPercentage",
"metricNamespace": "microsoft.aks",
"operator": "GreaterThan",
"threshold": 70,
"timeAggregation": "Average",
"statistic": "Average",
"timeWindow": "PT5M"
},
"scaleAction": {
"direction": "Increase",
"type": "ChangeCount",
"value": "1",
"cooldown": "PT5M"
}
}
]
}
]
}
}
}
在上述示例中,autoScaleProfile
部分配置了自动缩放器。enabled
属性启用了自动缩放器功能。minNodeCount
和maxNodeCount
属性指定了节点的最小和最大数量。
profiles
数组定义了自动缩放器的配置规则。在示例中,我们定义了一个名为"default"的配置规则。capacity
属性指定了节点的最小、最大和默认数量。rules
数组定义了触发自动缩放的规则。在示例中,我们定义了一个基于CPU使用率的规则,当CPU使用率超过70%时,会增加1个节点。
请注意,此示例仅包含了一个自动缩放规则,您可以根据需要添加更多规则。
希望以上信息对您有所帮助!