首页 文章

nginx-ingress头盔图的'autoscaling'设置是否有效?

提问于
浏览
0

我尝试使用 values.yaml 文件中的 autoscaling 设置部署nginx-ingress,但似乎它不起作用 .

autoscaling:
    enabled: false
  #  minReplicas: 1
  #  maxReplicas: 11
  #  targetCPUUtilizationPercentage: 50

我尝试像这样部署一个nginx-ingress

helm upgrade --install ingress --set \
controller.service.type=NodePort,\
controller.service.nodePorts.http=$http_nodePort,\
controller.service.nodePorts.https=$https_nodePort,\
rbac.create=true,\
controller.replicaCount=$ingress_replicas,\
controller.stats.enabled=true,\
controller.metrics.enabled=true,\
controller.autoscaling.enabled=true,\
controller.autoscaling.minReplicas=1,\
controller.autoscaling.maxReplicas=10,\
controller.autoscaling.targetCPUUtilizationPercentage=50 \
stable/nginx-ingress

但是我得到了这个错误

Release "ingress" does not exist. Installing it now.
Error: release ingress failed: HorizontalPodAutoscaler.autoscaling "ingress-nginx-ingress-controller" is invalid: spec.metrics[1].resource.targetAverageUtilization: Required value: must set either a target raw value or a target utilization

有没有人设法使用自动缩放设置,或者您只是手动部署HPA?

EDIT 1 我尝试使用入口图表的本地副本相同的 helm upgrade ... 命令,该命令如下[有点旧]:

name: nginx-ingress
version: 0.11.1
appVersion: 0.11.0

它创造了HPA罚款!但是,我更愿意使用稳定的图表仓库进行部署 .

当前图表版本is this .

1 回答

  • 0

    看起来配置不一致或helm未在horizontal-autoscale环境中为nginx-ingress安装提供每个参数 .

    我查看了nginx-ingress图表的模板/ controller-hpa.yaml,我认为错过的变量是:

    controller.autoscaling.targetMemoryUtilizationPercentage=<value>

相关问题