-
Notifications
You must be signed in to change notification settings - Fork 53
/
mismatch_smee_deployment_replicas_test.yaml
55 lines (50 loc) · 2.51 KB
/
mismatch_smee_deployment_replicas_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
evaluation_interval: 1m
rule_files:
- prometheus.smee_deployment_alerts.yaml
tests:
- interval: 1m
input_series:
# Alerted cases:
# Actual deployments are lower than the spec in smee.* namespace, so it will be alerted.
- series: 'kube_deployment_spec_replicas{namespace="smee-client", deployment="gosmee", source_cluster="cluster01"}'
values: '2x5'
- series: 'kube_deployment_status_replicas_available{namespace="smee-client", deployment="gosmee", source_cluster="cluster01"}'
values: '1x5'
alert_rule_test:
- eval_time: 5m
alertname: SmeeDeploymentReplicasMismatch
exp_alerts:
- exp_labels:
severity: warning
namespace: smee-client
deployment: gosmee
source_cluster: cluster01
exp_annotations:
summary: >-
Smee deployment smee-client/gosmee replicas mismatch
description: >-
The number of replicas defined in smee-client/gosmee on cluster cluster01
is different than the actual number of replicas
alert_routing_key: smee-client
runbook_url: https://gitlab.cee.redhat.com/konflux/docs/sop/-/blob/main/o11y/alert-rule-SmeeDeploymentMismatch.md
- interval: 1m
input_series:
# Not Alerted cases:
# Actual deployments equals the spec, No alert
- series: 'kube_deployment_spec_replicas{namespace="smee", deployment="gosmee", source_cluster="cluster01"}'
values: '2x5'
- series: 'kube_deployment_status_replicas_available{namespace="smee", deployment="gosmee", source_cluster="cluster01"}'
values: '2x5'
# Actual deployments are lower than the spec in smee.* for less than 5 minutes, No alert
- series: 'kube_deployment_spec_replicas{namespace="smee-client", deployment="gosmee", source_cluster="cluster01"}'
values: '2x5'
- series: 'kube_deployment_status_replicas_available{namespace="smee-client", deployment="gosmee", source_cluster="cluster01"}'
values: '1x3 2x5'
# Actual deployments are lower than the spec but not in smee.* namespace, No alert
- series: 'kube_deployment_spec_replicas{namespace="ns-1", deployment="dep", source_cluster="cluster01"}'
values: '2x5'
- series: 'kube_deployment_status_replicas_available{namespace="ns-1", deployment="dep", source_cluster="cluster01"}'
values: '1x3 2x5'
alert_rule_test:
- eval_time: 5m
alertname: SmeeDeploymentReplicasMismatch