【发布时间】:2019-03-26 19:38:23
【问题描述】:
我在 Azure 中有一个使用 AKS 的单节点 K8s 集群。我使用一个简单的命令创建了一个部署和一个服务:
kubectl run php-apache --image=pilchard/hpa-example:latest --requests=cpu=200m,memory=300M --expose --port=80
并通过命令启用 HPA:
kubectl autoscale deployment php-apache --cpu-percent=10 --min=1 --max=15
在运行 kubectl describe hpa php-apache 时,我看到一条错误消息:
horizontal-pod-autoscaler unable to get metrics for resource cpu: unable to fetch metrics from API: the server could not find the requested resource (get pods.metrics.k8s.io)
horizontal-pod-autoscaler failed to get cpu utilization: unable to get metrics for resource cpu: unable to fetch metrics from API: the server could not find the requested resource (get pods.metrics.k8s.io)
运行kubectl get hpa 时,CPU 指标未知。任何帮助将不胜感激。
我的 AKS kube 版本是 v1.9.11。
【问题讨论】:
-
我认为您需要在 aks 上运行 heapster 才能使其工作
标签: azure kubernetes autoscaling azure-aks