Is the 'autoscaling' setting for the nginx-ingress helm chart working?

7/5/2018

I tried to deploy a nginx-ingress using the autoscaling setting inside the values.yaml file, but it seems that it does not work.

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

I try to deploy a nginx-ingress like this

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

but I get this error

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

Does anyone has managed to use the autoscaling setting, or you just deploy manually an HPA?

EDIT 1 I tried the same helm upgrade ... command with a local copy of the ingress chart which is the following [a bit old]:

name: nginx-ingress
version: 0.11.1
appVersion: 0.11.0

and it creates the HPA fine! However, I would prefer to deploy it using the stable chart repo.

The current chart version is this .

-- Kostas Demiris
kubernetes
kubernetes-helm
nginx

1 Answer

7/6/2018

It looks like configuration is inconsistent or helm is not providing every parameter to nginx-ingress installation in the horizontal-autoscale environment.

I’ve looked at templates/controller-hpa.yaml of nginx-ingress chart, and I think missed variable is:

controller.autoscaling.targetMemoryUtilizationPercentage=<value>

-- d0bry
Source: StackOverflow