Skip to content

Commit

Permalink
add rollout hpa
Browse files Browse the repository at this point in the history
  • Loading branch information
hanayo04 committed Aug 21, 2024
1 parent c019735 commit 3c5cd51
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
32 changes: 32 additions & 0 deletions php/templates/autoscaling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion php/templates/rollout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
12 changes: 12 additions & 0 deletions php/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}

0 comments on commit 3c5cd51

Please sign in to comment.