diff --git a/akka/Chart.yaml b/akka/Chart.yaml index 5ce7dd0c..c9fce21e 100644 --- a/akka/Chart.yaml +++ b/akka/Chart.yaml @@ -14,7 +14,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 0.2.17 +version: 0.2.18 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/akka/templates/autoscaling.yaml b/akka/templates/autoscaling.yaml index ae2aadf9..f4117686 100644 --- a/akka/templates/autoscaling.yaml +++ b/akka/templates/autoscaling.yaml @@ -25,7 +25,39 @@ spec: {{- toYaml .Values.autoscaling.metrics | nindent 4 }} minReplicas: {{ .Values.autoscaling.minReplicas }} scaleTargetRef: - kind: {{ .Values.autoscaling.scaleTargetRef.kind }} - apiVersion: {{ .Values.autoscaling.scaleTargetRef.apiVersion }} + kind: Deployment + apiVersion: apps/v1 name: "{{ template "akka.fullname" . }}" {{- 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 "akka.labels" . | nindent 4 }} + {{- with .Values.autoscalingRollout.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + name: "{{ template "akka.fullname" . }}" +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 "akka.fullname" . }}" +{{- end }} \ No newline at end of file diff --git a/akka/templates/deployment.yaml b/akka/templates/deployment.yaml index d8a621fe..3024ef72 100644 --- a/akka/templates/deployment.yaml +++ b/akka/templates/deployment.yaml @@ -13,7 +13,7 @@ metadata: {{- end }} name: "{{ include "akka.fullname" . }}" spec: - {{- if and (not .Values.autoscaling.enabled) .Values.replicaCount }} + {{- if and (not .Values.autoscaling.enabled) (ne .Values.replicaCount nil) }} replicas: {{ .Values.replicaCount }} {{- end }} selector: diff --git a/akka/templates/rollout.yaml b/akka/templates/rollout.yaml index 42e2be64..9375d87d 100644 --- a/akka/templates/rollout.yaml +++ b/akka/templates/rollout.yaml @@ -19,8 +19,10 @@ spec: template: {{- toYaml .Values.rollout.template | nindent 4 }} {{- end }} + {{- if and (not .Values.autoscalingRollout.enabled) (ne .Values.rollout.replicaCount nil) }} replicas: {{ .Values.rollout.replicaCount }} + {{- end }} revisionHistoryLimit: {{ .Values.rollout.revisionHistoryLimit }} - strategy: + strategy: {{- toYaml .Values.rollout.strategy | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/akka/values.yaml b/akka/values.yaml index 409fa79c..f56f28aa 100644 --- a/akka/values.yaml +++ b/akka/values.yaml @@ -290,9 +290,6 @@ autoscaling: metrics: [] # This feature is available since 1.18 behavior: {} - scaleTargetRef: - kind: Deployment - apiVersion: apps/v1 # Metrics Configuration. metrics: @@ -415,6 +412,19 @@ rollout: workloadRef: enabled: false template: {} - replicaCount: 3 + # If you want fix replicaCount, disable autoscalingRollout.enabled and uncomment the following line + #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: {}