首页 新闻 会员 周边

k8s 部署 HPA 自动伸缩失败:"unable to get metric http_requests"

0
悬赏园豆:50 [已解决问题] 解决于 2020-01-15 16:47

错误信息如下:

unable to get metric http_requests: unable to fetch metrics from custom metrics API: no custom metrics API (custom.metrics.k8s.io) registered

部署使用的 yaml 配置文件

apiVersion: autoscaling/v2beta2 
kind: HorizontalPodAutoscaler
metadata: 
  name: blog-web
spec: 
  scaleTargetRef: 
    apiVersion: apps/v1 
    kind: Deployment 
    name: blog-web
  minReplicas: 2
  maxReplicas: 12 
  metrics: 
    - type: Pods
      pods:
        metric:
          name: http_requests
        target:
          type: AverageValue
          averageValue: 100

请问如何解决?

k8s
dudu的主页 dudu | 高人七级 | 园豆:31003
提问于:2020-01-12 22:44
< >
分享
最佳答案
1
dudu | 高人七级 |园豆:31003 | 2020-01-15 16:47
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册