diff --git a/keda/Chart.yaml b/keda/Chart.yaml index 0a31e3ba..6b88aee3 100644 --- a/keda/Chart.yaml +++ b/keda/Chart.yaml @@ -8,7 +8,7 @@ kubeVersion: ">=v1.23.0-0" # 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.8.2 +version: 2.9.0 # 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 dc0760ca..00948dff 100644 --- a/keda/README.md +++ b/keda/README.md @@ -129,6 +129,10 @@ their default values. | `prometheus.metricServer.podMonitor.namespace` | Scraping namespace for metric server using podMonitor crd (prometheus operator) | `` | `prometheus.metricServer.podMonitor.additionalLabels` | Additional labels to add for metric server using podMonitor crd (prometheus operator) | `{}` | `prometheus.metricServer.podMonitor.relabelings` | List of expressions that define custom relabeling rules for metric server podMonitor crd (prometheus operator) | `[]` +| `prometheus.metricServer.prometheusRules.enabled` | Enable monitoring for keda metricServer using prometheusRules crd (prometheus operator) | `false` +| `prometheus.metricServer.prometheusRules.namespace` | Scraping namespace for keda metricServer using prometheusRules crd (prometheus operator) | `` +| `prometheus.metricServer.prometheusRules.additionalLabels` | Additional labels to add for keda metricServer using prometheusRules crd (prometheus operator) | `{}` +| `prometheus.metricServer.prometheusRules.alerts` | Additional alerts to add for keda metricServer using prometheusRules crd (prometheus operator) | `[]` | `prometheus.operator.enabled` | Enable keda operator prometheus metrics expose | `false` | `prometheus.operator.port` | HTTP port used for exposing keda operator prometheus metrics | `9022` | `prometheus.operator.path` | Path used for exposing keda operator prometheus metrics | `/metrics` @@ -137,10 +141,6 @@ 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) | `{}` -| `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) | `[]` | `prometheus.operator.podMonitor.relabelings` | List of expressions that define custom relabeling rules for keda operator podMonitor crd (prometheus operator) | `[]` | `volumes.keda.extraVolumes` | Extra volumes for keda deployment | `[]` | `volumes.keda.extraVolumeMounts` | Extra volume mounts for keda deployment | `[]` diff --git a/keda/templates/15-keda-prometheusrules.yaml b/keda/templates/15-keda-prometheusrules.yaml deleted file mode 100644 index 4e65c121..00000000 --- a/keda/templates/15-keda-prometheusrules.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{{- 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 }} - {{- include "keda.labels" . | indent 4 }} - {{- 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/templates/27-metrics-prometheusrules.yaml b/keda/templates/27-metrics-prometheusrules.yaml new file mode 100644 index 00000000..8076059e --- /dev/null +++ b/keda/templates/27-metrics-prometheusrules.yaml @@ -0,0 +1,20 @@ +{{- if and .Values.prometheus.metricServer.enabled .Values.prometheus.metricServer.prometheusRules.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ .Values.operator.name }}-metrics-apiserver + labels: + app.kubernetes.io/name: {{ .Values.operator.name }}-metrics-apiserver + {{- include "keda.labels" . | indent 4 }} + {{- range $key, $value := .Values.prometheus.metricServer.prometheusRules.additionalLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- with .Values.prometheus.metricServer.prometheusRules.namespace }} + namespace: {{ . }} + {{- end }} +spec: + groups: + - name: {{ .Values.operator.name }}-metrics-apiserver + rules: +{{ toYaml .Values.prometheus.metricServer.prometheusRules.alerts | indent 6 }} +{{- end }} diff --git a/keda/values.yaml b/keda/values.yaml index e288b626..8ab71d1c 100644 --- a/keda/values.yaml +++ b/keda/values.yaml @@ -272,18 +272,6 @@ prometheus: namespace: additionalLabels: {} relabelings: [] - operator: - enabled: false - port: 8080 - path: /metrics - podMonitor: - # Enables PodMonitor creation for the Prometheus Operator - enabled: false - interval: - scrapeTimeout: - namespace: - additionalLabels: {} - relabelings: [] prometheusRules: # Enables PrometheusRules creation for the Prometheus Operator enabled: false @@ -298,3 +286,15 @@ prometheus: # expr: sum by ( scaledObject , scaler) (rate(keda_metrics_adapter_scaler_errors[2m])) > 0 # for: 2m # labels: + operator: + enabled: false + port: 8080 + path: /metrics + podMonitor: + # Enables PodMonitor creation for the Prometheus Operator + enabled: false + interval: + scrapeTimeout: + namespace: + additionalLabels: {} + relabelings: []