-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Giovanni Liva <[email protected]>
- Loading branch information
Showing
95 changed files
with
62,379 additions
and
9 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
36 changes: 36 additions & 0 deletions
36
examples/observability/config/prometheus/alertmanager-alertmanager.yaml
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,36 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: Alertmanager | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: alert-router | ||
app.kubernetes.io/instance: main | ||
app.kubernetes.io/name: alertmanager | ||
app.kubernetes.io/part-of: kube-prometheus | ||
app.kubernetes.io/version: 0.24.0 | ||
name: main | ||
namespace: monitoring | ||
spec: | ||
image: quay.io/prometheus/alertmanager:v0.24.0 | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
podMetadata: | ||
labels: | ||
app.kubernetes.io/component: alert-router | ||
app.kubernetes.io/instance: main | ||
app.kubernetes.io/name: alertmanager | ||
app.kubernetes.io/part-of: kube-prometheus | ||
app.kubernetes.io/version: 0.24.0 | ||
replicas: 3 | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi | ||
requests: | ||
cpu: 4m | ||
memory: 100Mi | ||
securityContext: | ||
fsGroup: 2000 | ||
runAsNonRoot: true | ||
runAsUser: 1000 | ||
serviceAccountName: alertmanager-main | ||
version: 0.24.0 |
42 changes: 42 additions & 0 deletions
42
examples/observability/config/prometheus/alertmanager-networkPolicy.yaml
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,42 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: alert-router | ||
app.kubernetes.io/instance: main | ||
app.kubernetes.io/name: alertmanager | ||
app.kubernetes.io/part-of: kube-prometheus | ||
app.kubernetes.io/version: 0.24.0 | ||
name: alertmanager-main | ||
namespace: monitoring | ||
spec: | ||
egress: | ||
- {} | ||
ingress: | ||
- from: | ||
- podSelector: | ||
matchLabels: | ||
app.kubernetes.io/name: prometheus | ||
ports: | ||
- port: 9093 | ||
protocol: TCP | ||
- port: 8080 | ||
protocol: TCP | ||
- from: | ||
- podSelector: | ||
matchLabels: | ||
app.kubernetes.io/name: alertmanager | ||
ports: | ||
- port: 9094 | ||
protocol: TCP | ||
- port: 9094 | ||
protocol: UDP | ||
podSelector: | ||
matchLabels: | ||
app.kubernetes.io/component: alert-router | ||
app.kubernetes.io/instance: main | ||
app.kubernetes.io/name: alertmanager | ||
app.kubernetes.io/part-of: kube-prometheus | ||
policyTypes: | ||
- Egress | ||
- Ingress |
19 changes: 19 additions & 0 deletions
19
examples/observability/config/prometheus/alertmanager-podDisruptionBudget.yaml
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,19 @@ | ||
apiVersion: policy/v1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: alert-router | ||
app.kubernetes.io/instance: main | ||
app.kubernetes.io/name: alertmanager | ||
app.kubernetes.io/part-of: kube-prometheus | ||
app.kubernetes.io/version: 0.24.0 | ||
name: alertmanager-main | ||
namespace: monitoring | ||
spec: | ||
maxUnavailable: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/component: alert-router | ||
app.kubernetes.io/instance: main | ||
app.kubernetes.io/name: alertmanager | ||
app.kubernetes.io/part-of: kube-prometheus |
139 changes: 139 additions & 0 deletions
139
examples/observability/config/prometheus/alertmanager-prometheusRule.yaml
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,139 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: alert-router | ||
app.kubernetes.io/instance: main | ||
app.kubernetes.io/name: alertmanager | ||
app.kubernetes.io/part-of: kube-prometheus | ||
app.kubernetes.io/version: 0.24.0 | ||
prometheus: k8s | ||
role: alert-rules | ||
name: alertmanager-main-rules | ||
namespace: monitoring | ||
spec: | ||
groups: | ||
- name: alertmanager.rules | ||
rules: | ||
- alert: AlertmanagerFailedReload | ||
annotations: | ||
description: Configuration has failed to load for {{ $labels.namespace }}/{{ $labels.pod}}. | ||
runbook_url: https://runbooks.prometheus-operator.dev/runbooks/alertmanager/alertmanagerfailedreload | ||
summary: Reloading an Alertmanager configuration has failed. | ||
expr: | | ||
# Without max_over_time, failed scrapes could create false negatives, see | ||
# https://www.robustperception.io/alerting-on-gauges-in-prometheus-2-0 for details. | ||
max_over_time(alertmanager_config_last_reload_successful{job="alertmanager-main",namespace="monitoring"}[5m]) == 0 | ||
for: 10m | ||
labels: | ||
severity: critical | ||
- alert: AlertmanagerMembersInconsistent | ||
annotations: | ||
description: Alertmanager {{ $labels.namespace }}/{{ $labels.pod}} has only found {{ $value }} members of the {{$labels.job}} cluster. | ||
runbook_url: https://runbooks.prometheus-operator.dev/runbooks/alertmanager/alertmanagermembersinconsistent | ||
summary: A member of an Alertmanager cluster has not found all other cluster members. | ||
expr: | | ||
# Without max_over_time, failed scrapes could create false negatives, see | ||
# https://www.robustperception.io/alerting-on-gauges-in-prometheus-2-0 for details. | ||
max_over_time(alertmanager_cluster_members{job="alertmanager-main",namespace="monitoring"}[5m]) | ||
< on (namespace,service) group_left | ||
count by (namespace,service) (max_over_time(alertmanager_cluster_members{job="alertmanager-main",namespace="monitoring"}[5m])) | ||
for: 15m | ||
labels: | ||
severity: critical | ||
- alert: AlertmanagerFailedToSendAlerts | ||
annotations: | ||
description: Alertmanager {{ $labels.namespace }}/{{ $labels.pod}} failed to send {{ $value | humanizePercentage }} of notifications to {{ $labels.integration }}. | ||
runbook_url: https://runbooks.prometheus-operator.dev/runbooks/alertmanager/alertmanagerfailedtosendalerts | ||
summary: An Alertmanager instance failed to send notifications. | ||
expr: | | ||
( | ||
rate(alertmanager_notifications_failed_total{job="alertmanager-main",namespace="monitoring"}[5m]) | ||
/ | ||
rate(alertmanager_notifications_total{job="alertmanager-main",namespace="monitoring"}[5m]) | ||
) | ||
> 0.01 | ||
for: 5m | ||
labels: | ||
severity: warning | ||
- alert: AlertmanagerClusterFailedToSendAlerts | ||
annotations: | ||
description: The minimum notification failure rate to {{ $labels.integration }} sent from any instance in the {{$labels.job}} cluster is {{ $value | humanizePercentage }}. | ||
runbook_url: https://runbooks.prometheus-operator.dev/runbooks/alertmanager/alertmanagerclusterfailedtosendalerts | ||
summary: All Alertmanager instances in a cluster failed to send notifications to a critical integration. | ||
expr: | | ||
min by (namespace,service, integration) ( | ||
rate(alertmanager_notifications_failed_total{job="alertmanager-main",namespace="monitoring", integration=~`.*`}[5m]) | ||
/ | ||
rate(alertmanager_notifications_total{job="alertmanager-main",namespace="monitoring", integration=~`.*`}[5m]) | ||
) | ||
> 0.01 | ||
for: 5m | ||
labels: | ||
severity: critical | ||
- alert: AlertmanagerClusterFailedToSendAlerts | ||
annotations: | ||
description: The minimum notification failure rate to {{ $labels.integration }} sent from any instance in the {{$labels.job}} cluster is {{ $value | humanizePercentage }}. | ||
runbook_url: https://runbooks.prometheus-operator.dev/runbooks/alertmanager/alertmanagerclusterfailedtosendalerts | ||
summary: All Alertmanager instances in a cluster failed to send notifications to a non-critical integration. | ||
expr: | | ||
min by (namespace,service, integration) ( | ||
rate(alertmanager_notifications_failed_total{job="alertmanager-main",namespace="monitoring", integration!~`.*`}[5m]) | ||
/ | ||
rate(alertmanager_notifications_total{job="alertmanager-main",namespace="monitoring", integration!~`.*`}[5m]) | ||
) | ||
> 0.01 | ||
for: 5m | ||
labels: | ||
severity: warning | ||
- alert: AlertmanagerConfigInconsistent | ||
annotations: | ||
description: Alertmanager instances within the {{$labels.job}} cluster have different configurations. | ||
runbook_url: https://runbooks.prometheus-operator.dev/runbooks/alertmanager/alertmanagerconfiginconsistent | ||
summary: Alertmanager instances within the same cluster have different configurations. | ||
expr: | | ||
count by (namespace,service) ( | ||
count_values by (namespace,service) ("config_hash", alertmanager_config_hash{job="alertmanager-main",namespace="monitoring"}) | ||
) | ||
!= 1 | ||
for: 20m | ||
labels: | ||
severity: critical | ||
- alert: AlertmanagerClusterDown | ||
annotations: | ||
description: '{{ $value | humanizePercentage }} of Alertmanager instances within the {{$labels.job}} cluster have been up for less than half of the last 5m.' | ||
runbook_url: https://runbooks.prometheus-operator.dev/runbooks/alertmanager/alertmanagerclusterdown | ||
summary: Half or more of the Alertmanager instances within the same cluster are down. | ||
expr: | | ||
( | ||
count by (namespace,service) ( | ||
avg_over_time(up{job="alertmanager-main",namespace="monitoring"}[5m]) < 0.5 | ||
) | ||
/ | ||
count by (namespace,service) ( | ||
up{job="alertmanager-main",namespace="monitoring"} | ||
) | ||
) | ||
>= 0.5 | ||
for: 5m | ||
labels: | ||
severity: critical | ||
- alert: AlertmanagerClusterCrashlooping | ||
annotations: | ||
description: '{{ $value | humanizePercentage }} of Alertmanager instances within the {{$labels.job}} cluster have restarted at least 5 times in the last 10m.' | ||
runbook_url: https://runbooks.prometheus-operator.dev/runbooks/alertmanager/alertmanagerclustercrashlooping | ||
summary: Half or more of the Alertmanager instances within the same cluster are crashlooping. | ||
expr: | | ||
( | ||
count by (namespace,service) ( | ||
changes(process_start_time_seconds{job="alertmanager-main",namespace="monitoring"}[10m]) > 4 | ||
) | ||
/ | ||
count by (namespace,service) ( | ||
up{job="alertmanager-main",namespace="monitoring"} | ||
) | ||
) | ||
>= 0.5 | ||
for: 5m | ||
labels: | ||
severity: critical |
59 changes: 59 additions & 0 deletions
59
examples/observability/config/prometheus/alertmanager-secret.yaml
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,59 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: alert-router | ||
app.kubernetes.io/instance: main | ||
app.kubernetes.io/name: alertmanager | ||
app.kubernetes.io/part-of: kube-prometheus | ||
app.kubernetes.io/version: 0.24.0 | ||
name: alertmanager-main | ||
namespace: monitoring | ||
stringData: | ||
alertmanager.yaml: |- | ||
"global": | ||
"resolve_timeout": "5m" | ||
"inhibit_rules": | ||
- "equal": | ||
- "namespace" | ||
- "alertname" | ||
"source_matchers": | ||
- "severity = critical" | ||
"target_matchers": | ||
- "severity =~ warning|info" | ||
- "equal": | ||
- "namespace" | ||
- "alertname" | ||
"source_matchers": | ||
- "severity = warning" | ||
"target_matchers": | ||
- "severity = info" | ||
- "equal": | ||
- "namespace" | ||
"source_matchers": | ||
- "alertname = InfoInhibitor" | ||
"target_matchers": | ||
- "severity = info" | ||
"receivers": | ||
- "name": "Default" | ||
- "name": "Watchdog" | ||
- "name": "Critical" | ||
- "name": "null" | ||
"route": | ||
"group_by": | ||
- "namespace" | ||
"group_interval": "5m" | ||
"group_wait": "30s" | ||
"receiver": "Default" | ||
"repeat_interval": "12h" | ||
"routes": | ||
- "matchers": | ||
- "alertname = Watchdog" | ||
"receiver": "Watchdog" | ||
- "matchers": | ||
- "alertname = InfoInhibitor" | ||
"receiver": "null" | ||
- "matchers": | ||
- "severity = critical" | ||
"receiver": "Critical" | ||
type: Opaque |
25 changes: 25 additions & 0 deletions
25
examples/observability/config/prometheus/alertmanager-service.yaml
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 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: alert-router | ||
app.kubernetes.io/instance: main | ||
app.kubernetes.io/name: alertmanager | ||
app.kubernetes.io/part-of: kube-prometheus | ||
app.kubernetes.io/version: 0.24.0 | ||
name: alertmanager-main | ||
namespace: monitoring | ||
spec: | ||
ports: | ||
- name: web | ||
port: 9093 | ||
targetPort: web | ||
- name: reloader-web | ||
port: 8080 | ||
targetPort: reloader-web | ||
selector: | ||
app.kubernetes.io/component: alert-router | ||
app.kubernetes.io/instance: main | ||
app.kubernetes.io/name: alertmanager | ||
app.kubernetes.io/part-of: kube-prometheus | ||
sessionAffinity: ClientIP |
12 changes: 12 additions & 0 deletions
12
examples/observability/config/prometheus/alertmanager-serviceAccount.yaml
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,12 @@ | ||
apiVersion: v1 | ||
automountServiceAccountToken: false | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: alert-router | ||
app.kubernetes.io/instance: main | ||
app.kubernetes.io/name: alertmanager | ||
app.kubernetes.io/part-of: kube-prometheus | ||
app.kubernetes.io/version: 0.24.0 | ||
name: alertmanager-main | ||
namespace: monitoring |
Oops, something went wrong.