diff --git a/cr.yaml b/cr.yaml index 75778f5..6e11c67 100644 --- a/cr.yaml +++ b/cr.yaml @@ -5,4 +5,4 @@ charts-dir: squadcast-helm sign: false charts_repo_url: https://squadcasthub.github.io/helm-infra index-path: . -version: 0.2.4 +version: 0.2.5 diff --git a/squadcast-helm/Chart.yaml b/squadcast-helm/Chart.yaml index facde7c..e6aaf4e 100644 --- a/squadcast-helm/Chart.yaml +++ b/squadcast-helm/Chart.yaml @@ -3,6 +3,6 @@ name: squadcast-helm description: A Helm chart for Kubernetes type: application -version: 0.2.4 +version: 0.2.5 appVersion: "1.16.0" diff --git a/squadcast-helm/templates/hpa.yaml b/squadcast-helm/templates/hpa.yaml index b02ca8f..eb93524 100644 --- a/squadcast-helm/templates/hpa.yaml +++ b/squadcast-helm/templates/hpa.yaml @@ -1,30 +1,34 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: {{ include "squadcast-helm.fullname" . }} - labels: + name: {{ include "squadcast-helm.fullname" . }} + labels: {{- include "squadcast-helm.labels" . | nindent 4 }} - namespace: {{ .Values.namespace }} + namespace: {{ .Values.namespace }} spec: - scaleTargetRef: + scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: {{ include "squadcast-helm.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }}