Skip to content

Commit

Permalink
[kube-prometheus-stack] Add alertmanagerConfigSelector option (#311)
Browse files Browse the repository at this point in the history
* Add alertmanagerConfigSelector to alertmanagerConfigSpec. Provide examples in values.yaml.

Signed-off-by: Landon Orr <landonwo@gmail.com>

* Bump version to 11.1.0. Remove tiller key due to unexpected element error from chart testing.

Signed-off-by: Landon Orr <landonwo@gmail.com>

* Add support for alertmanagerConfigNamespaceSelector.

Signed-off-by: Landon Orr <landonwo@gmail.com>

Co-authored-by: Bismarck Paliz <bismarck.paliz@jet.com>
  • Loading branch information
metroshica and Bismarck Paliz authored Nov 9, 2020
1 parent 53c52f4 commit 819d9db
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 11.0.5
version: 11.1.0
appVersion: 0.43.2
tillerVersion: ">=2.12.0"
kubeVersion: ">=1.16.0-0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ spec:
configMaps:
{{ toYaml .Values.alertmanager.alertmanagerSpec.configMaps | indent 4 }}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.alertmanagerConfigSelector }}
alertmanagerConfigSelector:
{{ toYaml .Values.alertmanager.alertmanagerSpec.alertmanagerConfigSelector | indent 4}}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.alertmanagerConfigNamespaceSelector }}
alertmanagerConfigNamespaceSelector:
{{ toYaml .Values.alertmanager.alertmanagerSpec.alertmanagerConfigNamespaceSelector | indent 4}}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.resources }}
resources:
{{ toYaml .Values.alertmanager.alertmanagerSpec.resources | indent 4 }}
Expand Down
36 changes: 36 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,42 @@ alertmanager:
##
# configSecret:

## AlertmanagerConfigs to be selected to merge and configure Alertmanager with.
##
alertmanagerConfigSelector: {}
## Example which selects all alertmanagerConfig resources
## with label "alertconfig" with values any of "example-config" or "example-config-2"
# alertmanagerConfigSelector:
# matchExpressions:
# - key: alertconfig
# operator: In
# values:
# - example-config
# - example-config-2
#
## Example which selects all alertmanagerConfig resources with label "role" set to "example-config"
# alertmanagerConfigSelector:
# matchLabels:
# role: example-config

## Namespaces to be selected for AlertmanagerConfig discovery. If nil, only check own namespace.
##
alertmanagerConfigNamespaceSelector: {}
## Example which selects all namespaces
## with label "alertmanagerconfig" with values any of "example-namespace" or "example-namespace-2"
# alertmanagerConfigNamespaceSelector:
# matchExpressions:
# - key: alertmanagerconfig
# operator: In
# values:
# - example-namespace
# - example-namespace-2

## Example which selects all namespaces with label "alertmanagerconfig" set to "enabled"
# alertmanagerConfigNamespaceSelector:
# matchLabels:
# alertmanagerconfig: enabled

## Define Log Format
# Use logfmt (default) or json-formatted logging
logFormat: logfmt
Expand Down

0 comments on commit 819d9db

Please sign in to comment.