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

metrics: move prometheusrules under metricServer #316

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont think you wanted to use operator?

enabled: false
port: 8080
path: /metrics
podMonitor:
# Enables PodMonitor creation for the Prometheus Operator
enabled: false
interval:
scrapeTimeout:
namespace:
additionalLabels: {}
relabelings: []