diff --git a/keda/Chart.yaml b/keda/Chart.yaml index d1a21dbf..edc2bb43 100644 --- a/keda/Chart.yaml +++ b/keda/Chart.yaml @@ -4,7 +4,7 @@ description: Event-based autoscaler for workloads on Kubernetes # 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: 2.3.0 +version: 2.3.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/keda/README.md b/keda/README.md index b266acbc..53eef684 100644 --- a/keda/README.md +++ b/keda/README.md @@ -112,10 +112,14 @@ their default values. | `prometheus.operator.podMonitor.scrapeTimeout` | Scraping timeout for keda operator using podMonitor crd (prometheus operator) | `` | `prometheus.operator.podMonitor.namespace` | Scraping namespace for keda operator using podMonitor crd (prometheus operator) | `` | `prometheus.operator.podMonitor.additionalLabels` | Additional labels to add for keda operator using podMonitor crd (prometheus operator) | `{}` -| `volumes.keda.extraVolumes` | Extra volumes for keda deployment | `[]` -| `volumes.keda.extraVolumeMounts` | Extra volume mounts for keda deployment | `[]` -| `volumes.metricsApiServer.extraVolumes` | Extra volumes for metric server deployment | `[]` -| `volumes.metricsApiServer.extraVolumeMounts` | Extra volume mounts for metric server deployment | `[]` +| `prometheus.operator.prometheusRules.enabled` | Enable monitoring for keda operator using prometheusRules crd (prometheus operator) | `false` +| `prometheus.operator.prometheusRules.namespace` | Scraping namespace for keda operator using prometheusRules crd (prometheus operator) | `` +| `prometheus.operator.prometheusRules.additionalLabels` | Additional labels to add for keda operator using prometheusRules crd (prometheus operator) | `{}` +| `prometheus.operator.prometheusRules.alerts` | Additional alerts to add for keda operator using prometheusRules crd (prometheus operator) | `[]` +| `volumes.keda.extraVolumes` | Extra volumes for keda deployment | `[]` +| `volumes.keda.extraVolumeMounts` | Extra volume mounts for keda deployment | `[]` +| `volumes.metricsApiServer.extraVolumes` | Extra volumes for metric server deployment | `[]` +| `volumes.metricsApiServer.extraVolumeMounts` | Extra volume mounts for metric server deployment | `[]` Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example: diff --git a/keda/templates/15-keda-prometheusrules.yaml b/keda/templates/15-keda-prometheusrules.yaml new file mode 100644 index 00000000..1ba3bdfc --- /dev/null +++ b/keda/templates/15-keda-prometheusrules.yaml @@ -0,0 +1,23 @@ +{{- if and .Values.prometheus.operator.enabled .Values.prometheus.operator.prometheusRules.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: prometheusRule +metadata: + name: {{ .Values.operator.name }} + labels: + app.kubernetes.io/name: {{ .Values.operator.name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/part-of: {{ .Values.operator.name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + {{- range $key, $value := .Values.prometheus.operator.prometheusRules.additionalLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- with .Values.prometheus.operator.prometheusRules.namespace }} + namespace: {{ . }} + {{- end }} +spec: + groups: + - name: {{ .Values.operator.name }} + rules: +{{ toYaml .Values.prometheus.operator.prometheusRules.alerts | indent 6 }} +{{- end }} diff --git a/keda/values.yaml b/keda/values.yaml index df0d88a9..3c52c13e 100644 --- a/keda/values.yaml +++ b/keda/values.yaml @@ -177,3 +177,18 @@ prometheus: scrapeTimeout: namespace: additionalLabels: {} + prometheusRules: + # Enables PrometheusRules creation for the Prometheus Operator + enabled: false + namespace: + additionalLabels: {} + alerts: [] + # - alert: KedaScalerErrors + # annotations: + # description: Keda scaledObject {{ $labels.scaledObject }} is experiencing erros with {{ $labels.scaler }} scaler + # summary: Keda Scaler {{ $labels.scaler }} Errors + # expr: sum by ( scaledObject , scaler) (rate(keda_metrics_adapter_scaler_errors[2m])) > 0 + # for: 2m + # labels: + +