github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/ingress-nginx/templates/default-backend-hpa.yaml (about)

     1  {{- if and .Values.defaultBackend.enabled .Values.defaultBackend.autoscaling.enabled }}
     2  apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta1" (semverCompare ">=1.23.0-0" .Capabilities.KubeVersion.Version) }}
     3  kind: HorizontalPodAutoscaler
     4  metadata:
     5    labels:
     6      {{- include "ingress-nginx.labels" . | nindent 4 }}
     7      app.kubernetes.io/component: default-backend
     8      {{- with .Values.defaultBackend.labels }}
     9      {{- toYaml . | nindent 4 }}
    10      {{- end }}
    11    name: {{ template "ingress-nginx.defaultBackend.fullname" . }}
    12    namespace: {{ .Release.Namespace }}
    13  spec:
    14    scaleTargetRef:
    15      apiVersion: apps/v1
    16      kind: Deployment
    17      name: {{ template "ingress-nginx.defaultBackend.fullname" . }}
    18    minReplicas: {{ .Values.defaultBackend.autoscaling.minReplicas }}
    19    maxReplicas: {{ .Values.defaultBackend.autoscaling.maxReplicas }}
    20    metrics:
    21  {{- with .Values.defaultBackend.autoscaling.targetCPUUtilizationPercentage }}
    22      - type: Resource
    23        resource:
    24          name: cpu
    25          target:
    26            type: Utilization
    27            averageUtilization: {{ . }}
    28  {{- end }}
    29  {{- with .Values.defaultBackend.autoscaling.targetMemoryUtilizationPercentage }}
    30      - type: Resource
    31        resource:
    32          name: memory
    33          target:
    34            type: Utilization
    35            averageUtilization: {{ . }}
    36  {{- end }}
    37  {{- end }}