forked from nixys/nxs-universal-chart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PrometheusRule support and tests
- Loading branch information
Evgeny Tereshkov
committed
Jun 13, 2022
1 parent
063781c
commit af6c699
Showing
8 changed files
with
135 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
apiVersion: v2 | ||
description: Nixys universal Helm chart for deploy your apps to Kubernetes | ||
name: universal-chart | ||
version: 3.2.0 | ||
version: 3.3.0 | ||
maintainers: | ||
- name: Roman Andreev | ||
email: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
# Source: universal-chart/templates/prometheusrule.yml | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: test-promrule | ||
namespace: "default" | ||
labels: | ||
app.kubernetes.io/name: test | ||
app.kubernetes.io/instance: test | ||
app.kubernetes.io/managed-by: Helm | ||
foo: bar | ||
spec: | ||
groups: | ||
- name: "job_rules" | ||
interval: 1m | ||
rules: | ||
- alert: "RedisDown" | ||
expr: redis_up == 0 | ||
for: 2m | ||
labels: | ||
severity: critical | ||
annotations: | ||
description: Redis instance "{{ $labels.instance }}" is down. | ||
summary: Redis instance "{{ $labels.instance }}" down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
prometheusrules: | ||
promrule: | ||
labels: | ||
foo: bar | ||
groups: | ||
job_rules: | ||
interval: 1m | ||
rules: | ||
RedisDown: | ||
expr: redis_up == 0 | ||
for: 2m | ||
labels: | ||
severity: critical | ||
annotations: | ||
summary: Redis instance "{{ $labels.instance }}" down | ||
description: Redis instance "{{ $labels.instance }}" is down. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{- range $name, $rule := .Values.prometheusrules }} | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: {{ include "helpers.app.fullname" (dict "name" $name "context" $) }} | ||
namespace: {{ $.Release.Namespace | quote }} | ||
labels: | ||
{{- include "helpers.app.labels" $ | nindent 4 }} | ||
{{- with .labels }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}{{- end }} | ||
spec: | ||
groups: | ||
{{- range $gname, $group := $rule.groups }} | ||
- name: {{ $gname | quote }} | ||
interval: {{ .interval }} | ||
rules: | ||
{{- range $aname, $alert := .rules }} | ||
- alert: {{ $aname | quote }} | ||
expr: {{ .expr }} | ||
for: {{ .for }} | ||
labels: | ||
{{- range $key, $value := .labels }} | ||
{{ $key }}: {{ $value }} | ||
{{- end }} | ||
annotations: | ||
{{- range $key, $value := .annotations }} | ||
{{ $key }}: {{ $value }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters