Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Kubernetes: `>=1.29.0-0`
| cluster.monitoring.podMonitor.labels | object | `{}` | Additional labels to set on the generated PodMonitor resource. Add labels your monitoring stack requires (for example `team-name`). |
| cluster.monitoring.podMonitor.metricRelabelings | list | `[]` | The list of metric relabelings for the PodMonitor. Applied to samples before ingestion. |
| cluster.monitoring.podMonitor.relabelings | list | `[]` | The list of relabelings for the PodMonitor. Applied to samples before scraping. |
| cluster.monitoring.prometheusRule.addAlertExtraLabels | object | `{}` | Additional labels to add to all alerts generated by the PrometheusRule. |
| cluster.monitoring.prometheusRule.enabled | bool | `true` | Whether to enable the PrometheusRule automated alerts |
| cluster.monitoring.prometheusRule.excludeRules | list | `[]` | Exclude specified rules |
| cluster.podSecurityContext | object | `{}` | Configure the Pod Security Context. See: https://cloudnative-pg.io/documentation/preview/security/ |
Expand Down
3 changes: 3 additions & 0 deletions charts/cluster/prometheus_rules/cluster-ha-critical.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ labels:
severity: critical
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
3 changes: 3 additions & 0 deletions charts/cluster/prometheus_rules/cluster-ha-warning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ labels:
severity: warning
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ labels:
severity: critical
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ labels:
severity: warning
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ labels:
severity: warning
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ labels:
severity: warning
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ labels:
severity: critical
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ labels:
severity: warning
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ labels:
severity: critical
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ labels:
severity: warning
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ labels:
severity: critical
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ labels:
severity: warning
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ labels:
severity: critical
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ labels:
severity: warning
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
3 changes: 3 additions & 0 deletions charts/cluster/prometheus_rules/cluster-offline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ labels:
severity: critical
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ labels:
severity: critical
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ labels:
severity: warning
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ labels:
severity: warning
namespace: {{ .namespace }}
cnpg_cluster: {{ .cluster }}
{{- range $key, $val := .addAlertExtraLabels }}
{{ $key }}: {{ $val | toString }}
{{- end }}
{{- end -}}
1 change: 1 addition & 0 deletions charts/cluster/templates/prometheus-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ spec:
- name: cloudnative-pg/{{ include "cluster.fullname" . }}
rules:
{{- $dict := dict "excludeRules" .Values.cluster.monitoring.prometheusRule.excludeRules -}}
{{- $_ := set $dict "addAlertExtraLabels" .Values.cluster.monitoring.prometheusRule.addAlertExtraLabels -}}
{{- $_ := set $dict "value" "{{ $value }}" -}}
{{- $_ := set $dict "namespace" .Release.Namespace -}}
{{- $_ := set $dict "cluster" (include "cluster.fullname" .) -}}
Expand Down
3 changes: 3 additions & 0 deletions charts/cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@
},
"excludeRules": {
"type": "array"
},
"addAlertExtraLabels": {
"type": "object"
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ cluster:
# -- Exclude specified rules
excludeRules: []
# - CNPGClusterZoneSpreadWarning
# -- Additional labels to add to all alerts generated by the PrometheusRule.
addAlertExtraLabels: {}
# alert_email: "true"
# environment: staging
# Additional instrumentation via custom metrics
instrumentation:
# -- Enable logical replication metrics
Expand Down
Loading