Skip to content

Commit

Permalink
Disable vault and cluster-service rules for CAPO and CAPV (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
erkanerol authored Apr 11, 2022
1 parent eb9edc2 commit e7a1136
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Disable `cluster-service` and `vault` rules for CAPO and CAPV.

## [2.12.0] - 2022-04-11

### Added
Expand Down
16 changes: 16 additions & 0 deletions helm/prometheus-rules/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,19 @@ phoenix
"false"
{{- end -}}
{{- end -}}

{{- define "isClusterServiceInstalled" -}}
{{- if has .Values.managementCluster.provider.kind (list "openstack" "vsphere") -}}
false
{{- else -}}
true
{{- end -}}
{{- end -}}

{{- define "isVaultBeingMonitored" -}}
{{- if has .Values.managementCluster.provider.kind (list "openstack" "vsphere") -}}
false
{{- else -}}
true
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq (include "isClusterServiceInstalled" .) "true" }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
Expand Down Expand Up @@ -32,3 +33,4 @@ spec:
labels:
severity: notify
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq (include "isVaultBeingMonitored" .) "true" }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
Expand Down Expand Up @@ -83,3 +84,4 @@ spec:
severity: page
team: {{ include "providerTeam" . }}
topic: vault
{{- end }}

0 comments on commit e7a1136

Please sign in to comment.