Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

stable/airflow Add support for prometheus rules to the airflow helm chart #13662

Merged
Merged
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 stable/airflow/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description: Airflow is a platform to programmatically author, schedule and monitor workflows
name: airflow
version: 2.7.1
version: 2.8.0
appVersion: 1.10.2
icon: https://airflow.apache.org/_images/pin_large.png
home: https://airflow.apache.org/
Expand Down
3 changes: 3 additions & 0 deletions stable/airflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ The following table lists the configurable parameters of the Airflow chart and t
| `serviceMonitor.interval` | Interval at which metrics should be scraped | `30s` |
| `serviceMonitor.path` | The path at which the metrics should be scraped | `/admin/metrics` |
| `serviceMonitor.selector` | label Selector for Prometheus to find ServiceMonitors | `prometheus: kube-prometheus` |
| `prometheusRule.enabled` | enable prometheus rule | `false` |
| `prometheusRule.groups` | define alerting rules | `{}` |
| `prometheusRule.additionalLabels` | add additional labels to the prometheus rule | `{}` |


Full and up-to-date documentation can be found in the comments of the `values.yaml` file.
Expand Down
17 changes: 17 additions & 0 deletions stable/airflow/templates/prometheus-rule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.prometheusRule.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ template "airflow.fullname" . }}
labels:
app: {{ template "airflow.name" . }}
chart: {{ template "airflow.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- if .Values.prometheusRule.additionalLabels }}
{{ toYaml .Values.prometheusRule.additionalLabels | indent 4 }}
{{- end }}
spec:
groups:
{{ toYaml .Values.prometheusRule.groups | indent 4 }}
{{- end }}
14 changes: 14 additions & 0 deletions stable/airflow/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -549,3 +549,17 @@ serviceMonitor:
## [Kube Prometheus Selector Label](https://github.com/helm/charts/tree/master/stable/prometheus-operator#exporters)
selector:
prometheus: kube-prometheus

# Enable this if you're using https://github.com/coreos/prometheus-operator
prometheusRule:
enabled: false
## Namespace in which the prometheus rule is created
# namespace: monitoring
## Define individual alerting rules as required
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#rulegroup
## https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/
groups: {}

## Used to pass Labels that are used by the Prometheus installed in your cluster to select Prometheus Rules to work with
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
additionalLabels: {}