diff --git a/helm/templates/eventhandler/deployment.yaml b/helm/templates/eventhandler/deployment.yaml index 57c9ce8cf1..db3bcfd456 100644 --- a/helm/templates/eventhandler/deployment.yaml +++ b/helm/templates/eventhandler/deployment.yaml @@ -6,12 +6,12 @@ metadata: {{- include "global.labels" . | nindent 4 }} app: {{ .Values.eventhandler.name }} spec: - replicas: 1 + replicas: {{ .Values.eventhandler.replicas }} strategy: type: RollingUpdate rollingUpdate: - maxSurge: {{ .Values.maxSurge }} - maxUnavailable: {{ .Values.maxUnavailable }} + maxSurge: {{ .Values.eventhandler.maxSurge }} + maxUnavailable: {{ .Values.eventhandler.maxUnavailable }} selector: matchLabels: app: {{ .Values.eventhandler.name }} diff --git a/helm/templates/eventhandler/hpa.yaml b/helm/templates/eventhandler/hpa.yaml new file mode 100644 index 0000000000..61095e6efb --- /dev/null +++ b/helm/templates/eventhandler/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.eventhandler.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ .Values.eventhandler.name }} + labels: + {{- include "global.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ .Values.eventhandler.name }} + minReplicas: {{ .Values.eventhandler.autoscaling.minReplicas }} + maxReplicas: {{ .Values.eventhandler.autoscaling.maxReplicas }} + metrics: + {{- if .Values.eventhandler.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.eventhandler.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.eventhandler.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.eventhandler.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }}