stable/prometheus-cloudwatch-exporter Add prometheusRule creation. (#21838)

* Add prometheusRule to prometheus-cloudwatch-exporter.

Signed-off-by: Danylo Hetmantsev <danylo.hetmantsev@syncier.com>

* Bump chart version.

Signed-off-by: Danylo Hetmantsev <danylo.hetmantsev@syncier.com>

* Update docs.

Signed-off-by: Danylo Hetmantsev <danylo.hetmantsev@syncier.com>

* Bump version.

Signed-off-by: Danylo Hetmantsev <danylo.hetmantsev@syncier.com>

* Change changelog.

Signed-off-by: Danylo Hetmantsev <danylo.hetmantsev@syncier.com>

* Add empty line.

Signed-off-by: Danylo Hetmantsev <danylo.hetmantsev@syncier.com>

* Remove empty line in changelog.

Signed-off-by: Danylo Hetmantsev <danylo.hetmantsev@syncier.com>
This commit is contained in:
Danylo Hetmantsev
2020-04-09 01:41:43 -07:00
committed by GitHub
parent fbdaa84049
commit 7badab07c8
5 changed files with 63 additions and 3 deletions
@@ -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
@@ -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
@@ -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 | `{}` |
@@ -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 }}
@@ -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: {}