diff --git a/php/Chart.yaml b/php/Chart.yaml index d4c17fd6..f51fdb24 100644 --- a/php/Chart.yaml +++ b/php/Chart.yaml @@ -15,7 +15,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: 1.4.0 +version: 1.4.1 # 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/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 new file mode 100644 index 00000000..31e4dd60 --- /dev/null +++ b/php/templates/rollout.yaml @@ -0,0 +1,28 @@ +{{- $root := . -}} +{{- if .Values.rollout.enabled -}} +apiVersion: argoproj.io/v1alpha1 +kind: Rollout +metadata: + name: {{ include "php.fullname" . }} + labels: + {{- include "php.labels" . | nindent 4 }} + {{- range $k, $v := .Values.labels }} + {{ $k }}: {{ $v | quote }} + {{- end }} +spec: + {{- if .Values.rollout.workloadRef.enabled }} + workloadRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "php.fullname" . }} + {{- else }} + 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: + {{- toYaml .Values.rollout.strategy | nindent 4 }} +{{- end }} diff --git a/php/values.yaml b/php/values.yaml index 88884cfc..6c672c51 100644 --- a/php/values.yaml +++ b/php/values.yaml @@ -464,3 +464,26 @@ fpm: # TEST test: enabled: true + +# Rollout configurations +rollout: + enabled: false + workloadRef: + enabled: false + template: {} + # 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: {}