Skip to content

Commit

Permalink
Add condition to Alert Manager default dashboard to prevent adding th…
Browse files Browse the repository at this point in the history
…e dashboard when AM is disabled

Signed-off-by: Phenix66 <[email protected]>
  • Loading branch information
Phenix66 committed Dec 31, 2024
1 parent 1f46261 commit 4bc4c77
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 67.5.0
version: 67.6.0
appVersion: v0.79.2
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def new_representer(dumper, data):

# Additional conditions map
condition_map = {
'alertmanager-overview': ' (or .Values.alertmanager.enabled .Values.alertmanager.forceDeployDashboards)',
'grafana-coredns-k8s': ' .Values.coreDns.enabled',
'etcd': ' .Values.kubeEtcd.enabled',
'apiserver': ' .Values.kubeApiServer.enabled',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Do not change in-place! In order to change this file first read following link:
https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/hack
*/ -}}
{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }}
{{- if and (or .Values.grafana.enabled .Values.grafana.forceDeployDashboards) (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.grafana.defaultDashboardsEnabled }}
{{- if and (or .Values.grafana.enabled .Values.grafana.forceDeployDashboards) (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.grafana.defaultDashboardsEnabled (or .Values.alertmanager.enabled .Values.alertmanager.forceDeployDashboards) }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
4 changes: 4 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ alertmanager:
##
enableFeatures: []

## Create dashboard configmap even if alertmanager deployment has been disabled
##
forceDeployDashboards: false

## Service account for Alertmanager to use.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
Expand Down

0 comments on commit 4bc4c77

Please sign in to comment.