diff --git a/charts/sftpgo/templates/hpa.yaml b/charts/sftpgo/templates/hpa.yaml index 9d34c9e..9e09af8 100644 --- a/charts/sftpgo/templates/hpa.yaml +++ b/charts/sftpgo/templates/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "sftpgo.fullname" . }} @@ -13,16 +13,5 @@ spec: minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} + {{- toYaml $.Values.autoscaling.metrics | nindent 4 }} {{- end }} diff --git a/charts/sftpgo/values.yaml b/charts/sftpgo/values.yaml index 6394f2b..76e40c6 100644 --- a/charts/sftpgo/values.yaml +++ b/charts/sftpgo/values.yaml @@ -258,8 +258,37 @@ autoscaling: enabled: false minReplicas: 1 maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 + # - type: Resource + # resource: + # name: cpu + # target: + # type: Utilization + # averageUtilization: 80 + # - type: Pods + # pods: + # metric: + # name: packets-per-second + # target: + # type: AverageValue + # averageValue: 1k + # - type: Object + # object: + # metric: + # name: requests-per-second + # describedObject: + # apiVersion: networking.k8s.io/v1 + # kind: Ingress + # name: main-route + # target: + # type: Value + # value: 10k # -- [Node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) configuration. nodeSelector: {}