【发布时间】:2018-11-06 22:31:00
【问题描述】:
我的集群上安装了 Kubernetes v1.12.1。 我从以下 repo 下载了 metrics-server: https://github.com/kubernetes-incubator/metrics-server
然后运行以下命令:
kubectl create -f metrics-server/deploy/1.8+/
然后我尝试使用以下方法自动缩放部署:
kubectl autoscale deployment example-app-tier --min 1 --max 3 --cpu-percent 70 --spacename example
但这里的目标显示未知/70%
kubectl get hpa --spacename example
NAMESPACE NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
example example-app-tier Deployment/example-app-tier <unknown>/70% 1 3 1 3h35m
当我尝试运行 kubectl 顶级节点或 pod 时,我收到一条错误消息:
error: Metrics not available for pod default/pi-ss8j6, age: 282h48m5.334137739s
所以我正在寻找任何教程,帮助我逐步启用使用 metrics-server 或 Prometheus(而不是 Heapster,因为它已被弃用且不再受支持)
谢谢!
【问题讨论】:
标签: kubernetes prometheus autoscaling