diff --git a/src/_base/helm/app/templates/horizontal-pod-autoscaler.yaml b/src/_base/helm/app/templates/horizontal-pod-autoscaler.yaml index 4643f30b2..56ff9c6c5 100644 --- a/src/_base/helm/app/templates/horizontal-pod-autoscaler.yaml +++ b/src/_base/helm/app/templates/horizontal-pod-autoscaler.yaml @@ -6,15 +6,15 @@ apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: - name: {{ print $.Release.Name "-" $serviceName }} + name: {{ print $.Values.resourcePrefix $serviceName }} labels: {{- include "chart.labels" $ | nindent 4 }} app.kubernetes.io/component: {{ $serviceName }} - app.service: {{ print $.Release.Name "-" $serviceName }} + app.service: {{ print $.Values.resourcePrefix $serviceName }} annotations: argocd.argoproj.io/sync-wave: "15" spec: - {{- with (omit $autoscaling "enabled" "metrics") }} + {{- with (pick $autoscaling "behavior" "minReplicas" "maxReplicas") }} {{- . | toYaml | nindent 2 }} {{- end }} metrics: @@ -38,7 +38,7 @@ spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ print $.Release.Name "-" $serviceName }} + name: {{ print $.Values.resourcePrefix $serviceName }} {{- end }} {{- end }} {{- end }} diff --git a/src/_base/helm/app/templates/pod-disruption-budgets.yaml b/src/_base/helm/app/templates/pod-disruption-budgets.yaml index 95a22c67c..902b307a8 100644 --- a/src/_base/helm/app/templates/pod-disruption-budgets.yaml +++ b/src/_base/helm/app/templates/pod-disruption-budgets.yaml @@ -2,7 +2,7 @@ {{- with $service }} {{- if and (not (hasPrefix "." $serviceName)) .enabled }} {{- $autoscaling := .autoscaling | default (dict "minReplicas" 0) -}} -{{- if or (gt (.replicas | default 1) 1) (and $autoscaling.enabled (gt $autoscaling.minReplicas 1)) }} +{{- if or (gt (.replicas | default 1 | int) 1) (and $autoscaling.enabled (gt ($autoscaling.minReplicas | int) 1)) }} --- apiVersion: policy/v1beta1 kind: PodDisruptionBudget @@ -15,7 +15,7 @@ metadata: annotations: argocd.argoproj.io/sync-wave: "15" spec: - minAvailable: {{- .minAvailable | default 1 }} + minAvailable: {{ .minAvailable | default 1 }} selector: matchLabels: app.service: {{ print $.Values.resourcePrefix $serviceName }}