diff --git a/php/templates/autoscaling.yaml b/php/templates/autoscaling.yaml index f5e656ed..b3ac3269 100644 --- a/php/templates/autoscaling.yaml +++ b/php/templates/autoscaling.yaml @@ -31,3 +31,35 @@ spec: {{- toYaml .Values.autoscaling.behavior | nindent 4 }} {{- end }} {{- end }} + +{{ if .Values.autoscalingRollout.enabled }} +--- +{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} +apiVersion: autoscaling/v2 +{{- else }} +apiVersion: autoscaling/v2beta2 +{{- end }} +kind: HorizontalPodAutoscaler +metadata: + annotations: + {{- toYaml .Values.autoscalingRollout.annotations | nindent 4}} + labels: + {{- include "php.labels" . | nindent 4 }} + {{- with .Values.autoscalingRollout.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + name: "{{ template "php.fullname" . }}-rollout" +spec: + {{- with .Values.autoscalingRollout.behavior }} + behavior: + {{- toYaml . | nindent 4 }} + {{- end }} + maxReplicas: {{ .Values.autoscalingRollout.maxReplicas }} + metrics: + {{- toYaml .Values.autoscalingRollout.metrics | nindent 4 }} + minReplicas: {{ .Values.autoscalingRollout.minReplicas }} + scaleTargetRef: + kind: Rollout + apiVersion: argoproj.io/v1alpha1 + name: "{{ template "php.fullname" . }}" +{{- end }} diff --git a/php/templates/rollout.yaml b/php/templates/rollout.yaml index 116327f1..37a87ac1 100644 --- a/php/templates/rollout.yaml +++ b/php/templates/rollout.yaml @@ -3,7 +3,7 @@ apiVersion: argoproj.io/v1alpha1 kind: Rollout metadata: - name: "{{ include "akka.containerName" . }}" + name: {{ include "php.fullname" . }} labels: {{- include "php.labels" . | nindent 4 }} {{- range $k, $v := .Values.labels }} diff --git a/php/values.yaml b/php/values.yaml index 036bb047..6c672c51 100644 --- a/php/values.yaml +++ b/php/values.yaml @@ -475,3 +475,15 @@ rollout: #replicaCount: 3 revisionHistoryLimit: 10 strategy: {} + +# HPA Configurattion for Rollout +autoscalingRollout: + # If true, enable HPA. + enabled: false + annotations: {} + labels: {} + minReplicas: + maxReplicas: + metrics: [] + # This feature is available since 1.18 + behavior: {}