From 7badab07c8e24744b40e3939652bd95e63e37812 Mon Sep 17 00:00:00 2001 From: Danylo Hetmantsev <42934251+danylohetmantsev@users.noreply.github.com> Date: Thu, 9 Apr 2020 11:41:43 +0300 Subject: [PATCH] stable/prometheus-cloudwatch-exporter Add prometheusRule creation. (#21838) * Add prometheusRule to prometheus-cloudwatch-exporter. Signed-off-by: Danylo Hetmantsev * Bump chart version. Signed-off-by: Danylo Hetmantsev * Update docs. Signed-off-by: Danylo Hetmantsev * Bump version. Signed-off-by: Danylo Hetmantsev * Change changelog. Signed-off-by: Danylo Hetmantsev * Add empty line. Signed-off-by: Danylo Hetmantsev * Remove empty line in changelog. Signed-off-by: Danylo Hetmantsev --- .../CHANGELOG.md | 6 ++++ .../prometheus-cloudwatch-exporter/Chart.yaml | 4 +-- .../prometheus-cloudwatch-exporter/README.md | 4 +++ .../templates/prometheusrule.yaml | 19 +++++++++++ .../values.yaml | 33 ++++++++++++++++++- 5 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 stable/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml diff --git a/stable/prometheus-cloudwatch-exporter/CHANGELOG.md b/stable/prometheus-cloudwatch-exporter/CHANGELOG.md index c31f87f959..f28c82ccba 100644 --- a/stable/prometheus-cloudwatch-exporter/CHANGELOG.md +++ b/stable/prometheus-cloudwatch-exporter/CHANGELOG.md @@ -7,6 +7,12 @@ numbering uses [semantic versioning](http://semver.org). NOTE: The change log until version 0.4.10 is auto generated based on git commits. Those include a reference to the git commit to be able to get more details. +## 0.7.0 + +PrometheusRule support added to chart. + +Updated cloudwatch-exporter version to [0.8.0](https://github.com/prometheus/cloudwatch_exporter/releases/tag/cloudwatch_exporter-0.8.0) + ## 0.5.0 Update Ingress and Deployment apiVersions for k8s 1.16 support diff --git a/stable/prometheus-cloudwatch-exporter/Chart.yaml b/stable/prometheus-cloudwatch-exporter/Chart.yaml index 9d9353df7c..c650dda382 100644 --- a/stable/prometheus-cloudwatch-exporter/Chart.yaml +++ b/stable/prometheus-cloudwatch-exporter/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 -appVersion: "0.6.0" +appVersion: "0.8.0" description: A Helm chart for prometheus cloudwatch-exporter name: prometheus-cloudwatch-exporter -version: 0.6.0 +version: 0.7.0 home: https://github.com/prometheus/cloudwatch_exporter sources: - https://github.com/prometheus/cloudwatch_exporter diff --git a/stable/prometheus-cloudwatch-exporter/README.md b/stable/prometheus-cloudwatch-exporter/README.md index 9ac5143261..ec4f317948 100644 --- a/stable/prometheus-cloudwatch-exporter/README.md +++ b/stable/prometheus-cloudwatch-exporter/README.md @@ -84,6 +84,10 @@ The following table lists the configurable parameters of the Cloudwatch Exporter | `serviceMonitor.timeout` | Timeout after which the scrape is ended | | | `serviceMonitor.relabelings` | RelabelConfigs to apply to samples before scraping. | | | `serviceMonitor.metricRelabelings`| MetricRelabelConfigs to apply to samples before ingestion. | | +| `prometheusRule.enabled` | Namespace thes PrometheusRule is installed in | `false` | +| `prometheusRule.namespace` | Use PrometheusRule from prometheus operator | | +| `prometheusRule.labels` | labels for the prometheusRule passed to Prometheus Operator | | +| `prometheusRule.rules` | Specify alerting rules in YAML format for PrometheusRule | | | `ingress.enabled` | Enables Ingress | `false` | | `ingress.annotations` | Ingress annotations | `{}` | | `ingress.labels` | Custom labels | `{}` | diff --git a/stable/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml b/stable/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml new file mode 100644 index 0000000000..e0c0b8e44c --- /dev/null +++ b/stable/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml @@ -0,0 +1,19 @@ +{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) ( .Values.prometheusRule.enabled ) }} +{{- $fullName := include "prometheus-cloudwatch-exporter.fullname" . -}} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: +{{- if .Values.prometheusRule.labels }} + labels: +{{ toYaml .Values.prometheusRule.labels | indent 4}} +{{- end }} + name: {{ $fullName }} +{{- if .Values.prometheusRule.namespace }} + namespace: {{ .Values.prometheusRule.namespace }} +{{- end }} +spec: + groups: + - name: {{ $fullName }} + rules: + {{- toYaml .Values.prometheusRule.rules | nindent 6 }} +{{- end }} diff --git a/stable/prometheus-cloudwatch-exporter/values.yaml b/stable/prometheus-cloudwatch-exporter/values.yaml index 2ddb9e2391..c4da6cb3e0 100644 --- a/stable/prometheus-cloudwatch-exporter/values.yaml +++ b/stable/prometheus-cloudwatch-exporter/values.yaml @@ -6,7 +6,7 @@ replicaCount: 1 image: repository: prom/cloudwatch-exporter - tag: cloudwatch_exporter-0.6.0 + tag: cloudwatch_exporter-0.8.0 pullPolicy: IfNotPresent # Example proxy configuration: @@ -151,6 +151,37 @@ serviceMonitor: # replacement: mydbname # targetLabel: dbname +prometheusRule: + # Specifies whether a PrometheusRule should be created + enabled: false + # Set the namespace the PrometheusRule should be deployed + # namespace: monitoring + # Set labels for the PrometheusRule, use this to define your scrape label for Prometheus Operator + # labels: + # Example - note the Kubernetes convention of camelCase instead of Prometheus' + # rules: + # - alert: ELB-Low-BurstBalance + # annotations: + # message: The ELB BurstBalance during the last 10 minutes is lower than 80%. + # expr: aws_ebs_burst_balance_average < 80 + # for: 10m + # labels: + # severity: warning + # - alert: ELB-Low-BurstBalance + # annotations: + # message: The ELB BurstBalance during the last 10 minutes is lower than 50%. + # expr: aws_ebs_burst_balance_average < 50 + # for: 10m + # labels: + # severity: warning + # - alert: ELB-Low-BurstBalance + # annotations: + # message: The ELB BurstBalance during the last 10 minutes is lower than 30%. + # expr: aws_ebs_burst_balance_average < 30 + # for: 10m + # labels: + # severity: critical + ingress: enabled: false annotations: {}