diff --git a/charts/signoz/Chart.lock b/charts/signoz/Chart.lock index 609bc8aa..c3fbcb4c 100644 --- a/charts/signoz/Chart.lock +++ b/charts/signoz/Chart.lock @@ -17,5 +17,8 @@ dependencies: - name: keycloak repository: https://charts.bitnami.com/bitnami version: 10.1.5 -digest: sha256:7e783326354b1036fdf23d8a1f7b0a2aaaaf913e26a61e166b223a24e50398fd -generated: "2023-02-25T02:08:05.683026+05:30" +- name: keda + repository: https://kedacore.github.io/charts + version: 2.10.1 +digest: sha256:f2d37726e7852762a95d8cd51212feb33b25d8663b51957a8e6630e75e8752ca +generated: "2023-03-15T23:34:34.121215+05:45" diff --git a/charts/signoz/Chart.yaml b/charts/signoz/Chart.yaml index b71b8a5e..fc8a8ae7 100644 --- a/charts/signoz/Chart.yaml +++ b/charts/signoz/Chart.yaml @@ -43,6 +43,10 @@ dependencies: repository: https://charts.bitnami.com/bitnami condition: keycloak.enabled version: 10.1.5 + - name: keda + repository: https://kedacore.github.io/charts + condition: keda.enabled + version: 2.10.1 maintainers: - name: SigNoz email: hello@signoz.io diff --git a/charts/signoz/charts/keda-2.10.1.tgz b/charts/signoz/charts/keda-2.10.1.tgz new file mode 100644 index 00000000..30615302 Binary files /dev/null and b/charts/signoz/charts/keda-2.10.1.tgz differ diff --git a/charts/signoz/templates/otel-collector/keda-auth.yaml b/charts/signoz/templates/otel-collector/keda-auth.yaml new file mode 100644 index 00000000..8d561725 --- /dev/null +++ b/charts/signoz/templates/otel-collector/keda-auth.yaml @@ -0,0 +1,30 @@ +{{- if and .Values.otelCollector.autoscaling.keda.enabled .Values.otelCollector.autoscaling.keda.auth.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "otelCollector.fullname" . }}-keda-secret +data: + customAuthHeader: {{ .Values.otelCollector.autoscaling.keda.auth.customHeaderName | b64enc }} + customAuthValue: {{ .Values.otelCollector.autoscaling.keda.auth.customHeaderValue | b64enc }} + {{- with .Values.otelCollector.autoscaling.keda.auth.customCA }} + ca: {{ . | b64enc }} + {{- end }} +--- +apiVersion: keda.sh/v1alpha1 +kind: TriggerAuthentication +metadata: + name: {{ .Values.otelCollector.autoscaling.keda.auth.triggerAuth }} +spec: + secretTargetRef: + - parameter: customAuthHeader + name: {{ include "otelCollector.fullname" . }}-keda-secret + key: customAuthHeader + - parameter: customAuthValue + name: {{ include "otelCollector.fullname" . }}-keda-secret + key: customAuthValue + {{- if .Values.otelCollector.autoscaling.keda.auth.customCA }} + - parameter: ca + name: {{ include "otelCollector.fullname" . }}-keda-secret + key: ca + {{- end }} +{{- end }} diff --git a/charts/signoz/templates/otel-collector/keda-autoscaler.yaml b/charts/signoz/templates/otel-collector/keda-autoscaler.yaml index 8d685784..898c2262 100644 --- a/charts/signoz/templates/otel-collector/keda-autoscaler.yaml +++ b/charts/signoz/templates/otel-collector/keda-autoscaler.yaml @@ -16,4 +16,4 @@ spec: triggers: {{- toYaml . | nindent 4 }} {{ end }} -{{ end }} +{{- end }} \ No newline at end of file diff --git a/charts/signoz/values.yaml b/charts/signoz/values.yaml index dd3fd08a..79390c49 100644 --- a/charts/signoz/values.yaml +++ b/charts/signoz/values.yaml @@ -682,15 +682,24 @@ frontend: autoscalingTemplate: [] keda: enabled: false + # -- KEDA polling interval in seconds pollingInterval: "30" # check 30sec periodically for metrics data + # -- KEDA cooldown period in seconds cooldownPeriod: "300" # once the load decreased, it will wait for 5 min and downscale + # -- KEDA minReplicaCount for HPA to scale down minReplicaCount: "1" # should be >= replicaCount specified in values.yaml + # -- KEDA maxReplicaCount for HPA to scale up maxReplicaCount: "5" + # -- KEDA triggers for HPA. + # Ref: https://keda.sh/docs/2.0/scalers + # @default -- See `values.yaml` for defaults triggers: + # memory type trigger to scale based on memory utilization - type: memory metadata: type: Utilization value: "80" # hpa make sure average Utilization <=80 by adding new pods + # cpu type trigger to scale based on cpu utilization - type: cpu metadata: type: Utilization @@ -1350,19 +1359,51 @@ otelCollector: autoscalingTemplate: [] keda: enabled: false + # -- KEDA polling interval in seconds pollingInterval: "30" # check 30sec periodically for metrics data + # -- KEDA cooldown period in seconds cooldownPeriod: "300" # once the load decreased, it will wait for 5 min and downscale + # -- KEDA minReplicaCount for HPA to scale down minReplicaCount: "1" # should be >= replicaCount specified in values.yaml + # -- KEDA maxReplicaCount for HPA to scale up maxReplicaCount: "5" + # KEDA custom authentication for HPA. + auth: + enabled: false + # -- KEDA trigger authentication name. This should match authentication ref name in prometheus trigger. + triggerAuth: signoz-keda-auth + # -- KEDA header name for authentication. + # In case of SigNoz, we set it to `SIGNOZ-API-KEY`. + customHeaderName: "SIGNOZ-API-KEY" + # -- KEDA header value for authentication. + # In case of SigNoz, we set it to personal access token of an user from SigNoz UI. (Enterprise) + customHeaderValue: "" + # might be required if you're using a custom CA + customCA: "" + # -- KEDA triggers for HPA. + # Ref: https://keda.sh/docs/2.0/scalers + # @default -- See `values.yaml` for defaults triggers: + # memory type trigger to scale based on memory utilization - type: memory metadata: type: Utilization value: "80" # hpa make sure average Utilization <=80 by adding new pods + # cpu type trigger to scale based on cpu utilization - type: cpu metadata: type: Utilization value: "80" # hpa make sure average Utlization <=80 by adding new pods + # prometheus type trigger to scale based on prometheus metrics. Enable keda.auth.enabled to use this. + # - type: prometheus + # metadata: + # serverAddress: http://my-release-signoz-query-service.platform.svc.cluster.local:8080 + # metricName: total_datapoints + # authModes: custom + # threshold: '10000' # threshold for total number of data points to consider for scaling + # query: sum(rate(otelcol_receiver_accepted_spans{signoz_k8s_component="otel-collector"}[5m]))+sum(rate(otelcol_receiver_accepted_metric_points{signoz_k8s_component="otel-collector"}[5m]))+sum(rate(otelcol_receiver_accepted_log_records{signoz_k8s_component="otel-collector"}[5m])) + # authenticationRef: + # name: signoz-keda-auth # -- Configurations for OtelCollector # @default -- See `values.yaml` for defaults @@ -2497,3 +2538,12 @@ keycloak: tls: true selfSigned: false + +### +### +### ---- KEDA ---- +### +### +# @ignored +keda: + enabled: false diff --git a/ct.yaml b/ct.yaml index a14a0fd6..56ce872b 100644 --- a/ct.yaml +++ b/ct.yaml @@ -14,4 +14,5 @@ chart-repos: - jetstack=https://charts.jetstack.io - ingress-nginx=https://kubernetes.github.io/ingress-nginx - minio=https://charts.min.io - - bitnami=https://charts.bitnami.com/bitnami \ No newline at end of file + - bitnami=https://charts.bitnami.com/bitnami + - kedacore=https://kedacore.github.io/charts