Skip to content

Commit

Permalink
feat(sftpgo): hpa apiVersion update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ant0wan committed Aug 29, 2024
1 parent 918ec8e commit 379abb2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 15 deletions.
15 changes: 2 additions & 13 deletions charts/sftpgo/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "sftpgo.fullname" . }}
Expand All @@ -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 }}
33 changes: 31 additions & 2 deletions charts/sftpgo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,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: {}
Expand Down

0 comments on commit 379abb2

Please sign in to comment.