diff --git a/charts/application-core/Chart.yaml b/charts/application-core/Chart.yaml index b7c7c25..3fe9b83 100644 --- a/charts/application-core/Chart.yaml +++ b/charts/application-core/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. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.7.0 +version: 1.8.0 maintainers: - name: Dominic DePasquale diff --git a/charts/application-core/templates/scaledobject.yaml b/charts/application-core/templates/scaledobject.yaml index a669cd4..6258bf1 100644 --- a/charts/application-core/templates/scaledobject.yaml +++ b/charts/application-core/templates/scaledobject.yaml @@ -1,4 +1,5 @@ {{- if and .Values.autoscaling.enabled (eq .Values.autoscaling.type "scaledobject" ) }} +{{- $fullName := include "application-core.fullname" . -}} apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: @@ -20,16 +21,35 @@ spec: minReplicaCount: {{ .Values.autoscaling.minReplicas }} maxReplicaCount: {{ .Values.autoscaling.maxReplicas }} triggers: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- if and .Values.autoscaling.targetCPUUtilizationPercentage (not .Values.autoscaling.kafka )}} - type: cpu metricType: Utilization metadata: value: {{ .Values.autoscaling.targetCPUUtilizationPercentage | quote }} {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- if and .Values.autoscaling.targetMemoryUtilizationPercentage (not .Values.autoscaling.kafka )}} - type: memory metricType: Utilization metadata: value: {{ .Values.autoscaling.targetMemoryUtilizationPercentage | quote }} {{- end }} -{{- end }} + {{- if .Values.autoscaling.kafka }} + - type: kafka + metadata: + {{- with .Values.autoscaling.kafka }} + bootstrapServers: {{ .bootstrapServers }} + consumerGroup: {{ default $fullName .consumerGroup }} + topic: {{ .topic }} + lagThreshold: {{ default 5 .lagThreshold | quote }} + offsetResetPolicy: {{ default "latest" .offsetResetPolicy }} + allowIdleConsumers: false + scaleToZeroOnInvalidOffset: false + excludePersistentLag: false + sasl: {{ default "plaintext" .sasl }} + tls: {{ default "enable" .tls }} + username: {{ .username }} + authenticationRef: + name: {{ default "keda-kafka-creds" .authenticationRef }} + {{- end }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/application-core/values.yaml b/charts/application-core/values.yaml index a208960..ebfa88c 100644 --- a/charts/application-core/values.yaml +++ b/charts/application-core/values.yaml @@ -134,6 +134,10 @@ autoscaling: maxReplicas: 10 targetCPUUtilizationPercentage: 80 targetMemoryUtilizationPercentage: 80 + # kafka: + # topic: this-topic + # bootstrapServers: this.web.address:9092 + # username: thisusername serviceProfile: create: false