github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/thanos/templates/storegateway/hpa.yaml (about)

     1  {{- if and .Values.storegateway.enabled .Values.storegateway.autoscaling.enabled (not .Values.storegateway.sharded.enabled) }}
     2  apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }}
     3  kind: HorizontalPodAutoscaler
     4  metadata:
     5    name: {{ include "common.names.fullname" . }}-storegateway
     6    namespace: {{ .Release.Namespace | quote }}
     7    labels: {{- include "common.labels.standard" . | nindent 4 }}
     8      app.kubernetes.io/component: storegateway
     9      {{- if .Values.commonLabels }}
    10      {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
    11      {{- end }}
    12    {{- if .Values.commonAnnotations }}
    13    annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
    14    {{- end }}
    15  spec:
    16    scaleTargetRef:
    17      apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
    18      kind: StatefulSet
    19      name: {{ include "common.names.fullname" . }}-storegateway
    20    minReplicas: {{ .Values.storegateway.autoscaling.minReplicas }}
    21    maxReplicas: {{ .Values.storegateway.autoscaling.maxReplicas }}
    22    metrics:
    23      {{- if .Values.storegateway.autoscaling.targetMemory }}
    24      - type: Resource
    25        resource:
    26          name: memory
    27          {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
    28          targetAverageUtilization: {{ .Values.storegateway.autoscaling.targetMemory }}
    29          {{- else }}
    30          target:
    31            type: Utilization
    32            averageUtilization: {{ .Values.storegateway.autoscaling.targetMemory }}
    33          {{- end }}
    34      {{- end }}
    35      {{- if .Values.storegateway.autoscaling.targetCPU }}
    36      - type: Resource
    37        resource:
    38          name: cpu
    39          {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
    40          targetAverageUtilization: {{ .Values.storegateway.autoscaling.targetCPU }}
    41          {{- else }}
    42          target:
    43            type: Utilization
    44            averageUtilization: {{ .Values.storegateway.autoscaling.targetCPU }}
    45          {{- end }}
    46      {{- end }}
    47  {{- end }}