Skip to content

Commit

Permalink
Add Kyverno updaterequests alert and tests
Browse files Browse the repository at this point in the history
Signed-off-by: Franco <[email protected]>
  • Loading branch information
fhielpos committed Nov 8, 2023
1 parent 3bbfb6f commit 9e19034
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
severity: page
team: shield
topic: kyverno
- name: reports
- name: resources
rules:
- alert: KyvernoAdmissionReportCountTooHigh
annotations:
Expand All @@ -42,6 +42,21 @@ spec:
severity: page
team: shield
topic: kyverno
- alert: KyvernoUpdateRequestsCountTooHigh
annotations:
description: "{{`Kyverno {{ $labels.kind }} are too high. This is an indicator that Kyverno\'s background controller may not be able to create some resources.`}}"
opsrecipe: kyverno-updaterequests/
expr: aggregation:kyverno_resource_counts{kind=~"(generate|update)requests.kyverno.io"} > 5000
for: 15m
labels:
area: managedservices
cancel_if_cluster_status_creating: "true"
cancel_if_cluster_status_deleting: "true"
cancel_if_cluster_status_updating: "true"
cancel_if_outside_working_hours: "false"
severity: notify
team: shield
topic: kyverno
- name: replicas
rules:
- alert: KyvernoScaledDownTooLong
Expand Down
20 changes: 20 additions & 0 deletions test/tests/providers/global/kyverno.all.rules.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ tests:
# Kyverno admission reports
- series: 'aggregation:kyverno_resource_counts{kind="admissionreports.kyverno.io"}'
values: "0+1000x30 30000+1500x30"
# Kyverno updaterequests
- series: 'aggregation:kyverno_resource_counts{kind="updaterequests.kyverno.io"}'
values: "0+100x15 5000+1500x30"
alert_rule_test:
# Webhooks alert
- alertname: KyvernoWebhookHasNoAvailableReplicas
Expand Down Expand Up @@ -54,6 +57,23 @@ tests:
exp_annotations:
description: "Kyverno admissionreports.kyverno.io are too high. This is an indicator that Kyverno's report processing may not be keeping up with cluster demand."
opsrecipe: "kyverno-reports/"
# Kyverno reports too high alert
- alertname: KyvernoUpdateRequestsCountTooHigh
eval_time: 45m
exp_alerts:
- exp_labels:
area: managedservices
severity: notify
team: shield
topic: kyverno
cancel_if_cluster_status_creating: "true"
cancel_if_cluster_status_deleting: "true"
cancel_if_cluster_status_updating: "true"
cancel_if_outside_working_hours: "false"
kind: "updaterequests.kyverno.io"
exp_annotations:
description: "Kyverno updaterequests.kyverno.io are too high. This is an indicator that Kyverno's background controller may not be able to create some resources."
opsrecipe: "kyverno-updaterequests/"
# Kyverno scaled down alert
- alertname: KyvernoScaledDownTooLong
eval_time: 240m
Expand Down

0 comments on commit 9e19034

Please sign in to comment.