Skip to content

Commit

Permalink
metrics: move prometheusrules under metricServer
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Nobel <[email protected]>
  • Loading branch information
erikkn committed Sep 20, 2022
1 parent 1a57533 commit b2dc235
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion keda/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions keda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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 | `[]`
Expand Down
20 changes: 0 additions & 20 deletions keda/templates/15-keda-prometheusrules.yaml

This file was deleted.

20 changes: 20 additions & 0 deletions keda/templates/27-metrics-prometheusrules.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
24 changes: 12 additions & 12 deletions keda/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: []

0 comments on commit b2dc235

Please sign in to comment.