istio.io/istio@v0.0.0-20240520182934-d79c90f27776/manifests/charts/istio-control/istio-discovery/templates/autoscale.yaml (about)

     1  {{- if and .Values.pilot.autoscaleEnabled .Values.pilot.autoscaleMin .Values.pilot.autoscaleMax }}
     2  apiVersion: autoscaling/v2
     3  kind: HorizontalPodAutoscaler
     4  metadata:
     5    name: istiod{{- if not (eq .Values.revision "") }}-{{ .Values.revision }}{{- end }}
     6    namespace: {{ .Release.Namespace }}
     7    labels:
     8      app: istiod
     9      release: {{ .Release.Name }}
    10      istio.io/rev: {{ .Values.revision | default "default" | quote }}
    11      install.operator.istio.io/owning-resource: {{ .Values.ownerName | default "unknown" }}
    12      operator.istio.io/component: "Pilot"
    13  spec:
    14    maxReplicas: {{ .Values.pilot.autoscaleMax }}
    15    minReplicas: {{ .Values.pilot.autoscaleMin }}
    16    scaleTargetRef:
    17      apiVersion: apps/v1
    18      kind: Deployment
    19      name: istiod{{- if not (eq .Values.revision "") }}-{{ .Values.revision }}{{- end }}
    20    metrics:
    21    - type: Resource
    22      resource:
    23        name: cpu
    24        target:
    25          type: Utilization
    26          averageUtilization: {{ .Values.pilot.cpu.targetAverageUtilization }}
    27    {{- if .Values.pilot.memory.targetAverageUtilization }}
    28    - type: Resource
    29      resource:
    30        name: memory
    31        target:
    32          type: Utilization
    33          averageUtilization: {{ .Values.pilot.memory.targetAverageUtilization }}
    34    {{- end }}
    35    {{- if .Values.pilot.autoscaleBehavior }}
    36    behavior: {{ toYaml .Values.pilot.autoscaleBehavior | nindent 4 }}
    37    {{- end }}
    38  ---
    39  {{- end }}