-
Notifications
You must be signed in to change notification settings - Fork 51
/
quota_exceeded_test.yaml
70 lines (60 loc) · 3.62 KB
/
quota_exceeded_test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
evaluation_interval: 1m
rule_files:
- prometheus.quota_alerts.yaml
tests:
- interval: 1m
input_series:
# namespace does not reach its quota limits
- series: 'kube_resourcequota{type="hard", namespace="not-reaching-limits", resourcequota="test-quota", resource="example-resource", source_cluster="cluster01"}'
values: '2x15'
- series: 'kube_resourcequota{type="used", namespace="not-reaching-limits", resourcequota="test-quota", resource="example-resource", source_cluster="cluster01"}'
values: '0x15'
# namespace reaches its quota limits
- series: 'kube_resourcequota{type="hard", namespace="reaching-limits", resourcequota="test-quota", resource="example-resource", source_cluster="cluster01"}'
values: '2x15'
- series: 'kube_resourcequota{type="used", namespace="reaching-limits", resourcequota="test-quota", resource="example-resource", source_cluster="cluster01"}'
values: '2x15'
# namespace exceeds its quota limits
- series: 'kube_resourcequota{type="hard", namespace="exceeding-limits", resourcequota="test-quota", resource="example-resource", source_cluster="cluster01"}'
values: '2x15'
- series: 'kube_resourcequota{type="used", namespace="exceeding-limits", resourcequota="test-quota", resource="example-resource", source_cluster="cluster01"}'
values: '5x15'
alert_rule_test:
- eval_time: 15m
alertname: QuotaExceeded
exp_alerts:
- exp_labels:
severity: warning
namespace: exceeding-limits
resource: example-resource
resourcequota: test-quota
source_cluster: cluster01
exp_annotations:
summary: >-
Resource example-resource in namespace exceeding-limits exceeded quota
test-quota
description: >-
Resource example-resource in namespace exceeding-limits on cluster
cluster01 exceeded quota test-quota.
alert_routing_key: exceeding-limits
runbook_url: https://gitlab.cee.redhat.com/konflux/docs/sop/-/blob/main/o11y/alert-rule-QuotaExceeded.md
- interval: 1m
input_series:
# Namespace exceeds its quota limits but since the name ends with 'env' it's ignored.
- series: 'kube_resourcequota{type="hard", namespace="test-env", resourcequota="test-quota", resource="example-resource", source_cluster="cluster01"}'
values: '2x15'
- series: 'kube_resourcequota{type="used", namespace="test-env", resourcequota="test-quota", resource="example-resource", source_cluster="cluster01"}'
values: '5x15'
# Namespace exceeds its quota limits but since it's named 'tekton-ci' it's ignored.
- series: 'kube_resourcequota{type="hard", namespace="tekton-ci", resourcequota="test-quota", resource="example-resource", source_cluster="cluster01"}'
values: '2x15'
- series: 'kube_resourcequota{type="used", namespace="tekton-ci", resourcequota="test-quota", resource="example-resource", source_cluster="cluster01"}'
values: '5x15'
# Namespace exceeds its quota limits but since it's named 'build-templates-e2e' it's ignored.
- series: 'kube_resourcequota{type="hard", namespace="build-templates-e2e", resourcequota="test-quota", resource="example-resource", source_cluster="cluster01"}'
values: '2x15'
- series: 'kube_resourcequota{type="used", namespace="build-templates-e2e", resourcequota="test-quota", resource="example-resource", source_cluster="cluster01"}'
values: '5x15'
alert_rule_test:
- eval_time: 15m
alertname: QuotaExceeded