Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support profiling for keda components #549

Merged
merged 5 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions keda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ their default values.
| `podDisruptionBudget.operator` | object | `{}` | Capability to configure [Pod Disruption Budget] |
| `podLabels.keda` | object | `{}` | Pod labels for KEDA operator |
| `podSecurityContext.operator` | object | [See below](#KEDA-is-secure-by-default) | [Pod security context] of the KEDA operator pod |
| `profiling.keda.enabled` | bool | `false` | Enable profiling for keda operator |
| `profiling.keda.port` | int | `8082` | Expose profiling on specific port |
| `resources.operator` | object | `{"limits":{"cpu":1,"memory":"1000Mi"},"requests":{"cpu":"100m","memory":"100Mi"}}` | Manage [resource request & limits] of KEDA operator pod |
| `securityContext.operator` | object | [See below](#KEDA-is-secure-by-default) | [Security context] of the operator container |
| `topologySpreadConstraints.operator` | list | `[]` | [Pod Topology Constraints] of KEDA operator pod |
Expand Down Expand Up @@ -153,6 +155,8 @@ their default values.
| `podDisruptionBudget.metricServer` | object | `{}` | Capability to configure [Pod Disruption Budget] |
| `podLabels.metricsAdapter` | object | `{}` | Pod labels for KEDA Metrics Adapter |
| `podSecurityContext.metricServer` | object | [See below](#KEDA-is-secure-by-default) | [Pod security context] of the KEDA metrics apiserver pod |
| `profiling.metricsApiServer.enabled` | bool | `false` | Enable profiling for keda metrics server |
| `profiling.metricsApiServer.port` | int | `8083` | Expose profiling on specific port |
| `resources.metricServer` | object | `{"limits":{"cpu":1,"memory":"1000Mi"},"requests":{"cpu":"100m","memory":"100Mi"}}` | Manage [resource request & limits] of KEDA metrics apiserver pod |
| `securityContext.metricServer` | object | [See below](#KEDA-is-secure-by-default) | [Security context] of the metricServer container |
| `service.annotations` | object | `{}` | Annotations to add the KEDA Metric Server service |
Expand Down Expand Up @@ -244,6 +248,8 @@ their default values.
| `podDisruptionBudget.webhooks` | object | `{}` | Capability to configure [Pod Disruption Budget] |
| `podLabels.webhooks` | object | `{}` | Pod labels for KEDA Admission webhooks |
| `podSecurityContext.webhooks` | object | [See below](#KEDA-is-secure-by-default) | [Pod security context] of the KEDA admission webhooks |
| `profiling.webhooks.enabled` | bool | `false` | Enable profiling for keda admission webhook |
| `profiling.webhooks.port` | int | `8084` | Expose profiling on specific port |
| `prometheus.webhooks.enabled` | bool | `false` | Enable KEDA admission webhooks prometheus metrics expose |
zroubalik marked this conversation as resolved.
Show resolved Hide resolved
| `prometheus.webhooks.port` | int | `8080` | Port used for exposing KEDA admission webhooks prometheus metrics |
| `prometheus.webhooks.prometheusRules.additionalLabels` | object | `{}` | Additional labels to add for KEDA admission webhooks using prometheusRules crd (prometheus operator) |
Expand Down
3 changes: 3 additions & 0 deletions keda/templates/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ spec:
{{- if .Values.opentelemetry.operator.enabled }}
- "--enable-opentelemetry-metrics={{ .Values.opentelemetry.operator.enabled}}"
{{- end }}
{{- if .Values.profiling.keda.enabled }}
- "--profiling-bind-address=:{{ .Values.profiling.keda.port }}"
{{- end }}
{{- range $key, $value := .Values.extraArgs.keda }}
- "--{{ $key }}={{ $value }}"
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions keda/templates/manager/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,10 @@ spec:
port: {{ .Values.prometheus.operator.port }}
targetPort: {{ .Values.prometheus.operator.port }}
{{- end }}
{{- if .Values.profiling.keda.enabled }}
- name: profiling
port: {{ .Values.profiling.keda.port }}
targetPort: {{ .Values.profiling.keda.port }}
{{- end }}
selector:
app: {{ .Values.operator.name }}
3 changes: 3 additions & 0 deletions keda/templates/metrics-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ spec:
- --tls-private-key-file={{ .Values.certificates.mountPath }}/tls.key
- --cert-dir={{ .Values.certificates.mountPath }}
- --v={{ .Values.logging.metricServer.level }}
{{- if .Values.profiling.metricsApiServer.enabled }}
- "--profiling-bind-address=:{{ .Values.profiling.metricsApiServer.port }}"
{{- end }}
{{- range $key, $value := .Values.extraArgs.metricsAdapter }}
- --{{ $key }}={{ $value }}
{{- end }}
Expand Down
6 changes: 6 additions & 0 deletions keda/templates/metrics-server/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,11 @@ spec:
port: {{ .Values.prometheus.metricServer.port }}
targetPort: {{ .Values.prometheus.metricServer.port }}
protocol: TCP
{{- if .Values.profiling.metricsApiServer.enabled }}
- name: profiling
port: {{ .Values.profiling.metricsApiServer.port }}
targetPort: {{ .Values.profiling.metricsApiServer.port }}
protocol: TCP
{{- end }}
selector:
app: {{ .Values.operator.name }}-metrics-apiserver
3 changes: 3 additions & 0 deletions keda/templates/webhooks/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ spec:
- "--port={{ .Values.webhooks.port }}"
{{- end }}
- --metrics-bind-address=:{{ .Values.prometheus.webhooks.port }}
{{- if .Values.profiling.webhooks.enabled }}
- "--profiling-bind-address=:{{ .Values.profiling.webhooks.port }}"
{{- end }}
{{- range $key, $value := .Values.extraArgs.webhooks }}
- --{{ $key }}={{ $value }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions keda/templates/webhooks/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ spec:
port: {{ .Values.prometheus.webhooks.port }}
targetPort: {{ .Values.prometheus.webhooks.port }}
{{- end }}
{{- if .Values.profiling.webhooks.enabled }}
- name: profiling
port: {{ .Values.profiling.webhooks.port }}
targetPort: {{ .Values.profiling.webhooks.port }}
{{- end }}
selector:
app: {{ .Values.webhooks.name }}
{{- end }}
15 changes: 15 additions & 0 deletions keda/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,21 @@ http:
# -- The minimum TLS version to use for all scalers that use raw HTTP clients (some scalers use SDKs to access target services. These have built-in HTTP clients, and this value does not necessarily apply to them)
minTlsVersion: TLS12

## This setting let you enable profiling for all of the components of keda and in specific port you choose
## This can be useful when trying to investigate errors like memory leak or cpu or even look at goroutines to understand better
## This setting is disabled by default
profiling:
keda:
enabled: false
port: 8082
metricsApiServer:
enabled: false
port: 8083
webhooks:
enabled: false
port: 8084
yuvalweber marked this conversation as resolved.
Show resolved Hide resolved


## Extra KEDA Operator and Metrics Adapter container arguments
extraArgs:
# -- Additional KEDA Operator container arguments
Expand Down
Loading