-
Notifications
You must be signed in to change notification settings - Fork 51
/
notready_pods_test.yaml
210 lines (189 loc) · 10.1 KB
/
notready_pods_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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
evaluation_interval: 1m
rule_files:
- prometheus.pod_alerts.yaml
tests:
- interval: 1m
input_series:
# Alerted cases:
# Pod is in the Pending state and scheduled, so it will be alerted.
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-1", phase="Pending", source_cluster="cluster01"}'
values: '1x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-1", phase="Unknown", source_cluster="cluster01"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-1", phase="Failed", source_cluster="cluster01"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-1", phase="Running", source_cluster="cluster01"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-1", phase="Succeeded", source_cluster="cluster01"}'
values: '0x29'
- series: 'kube_pod_status_unschedulable{namespace="ns-1", pod="pod-1", source_cluster="cluster01"}'
values: '0x29'
alert_rule_test:
- eval_time: 30m
alertname: PodNotReady
exp_alerts:
- exp_labels:
severity: warning
namespace: ns-1
pod: pod-1
phase: Pending
source_cluster: cluster01
exp_annotations:
summary: >-
Pod pod-1 is not ready
description: >-
Pod pod-1 in namespace ns-1 on cluster cluster01 is
not ready for more than 30 minutes.
alert_routing_key: ns-1
runbook_url: https://gitlab.cee.redhat.com/konflux/docs/sop/-/blob/main/o11y/alert-rule-PodNotReady.md
- interval: 1m
input_series:
# Pod is in the Unknown state and scheduled, so it will be alerted.
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-2", phase="Pending", source_cluster="cluster02"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-2", phase="Unknown", source_cluster="cluster02"}'
values: '1x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-2", phase="Failed", source_cluster="cluster02"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-2", phase="Running", source_cluster="cluster02"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-2", phase="Succeeded", source_cluster="cluster02"}'
values: '0x29'
- series: 'kube_pod_status_unschedulable{namespace="ns-2", pod="pod-1", source_cluster="cluster02"}'
values: '0x29'
alert_rule_test:
- eval_time: 30m
alertname: PodNotReady
exp_alerts:
- exp_labels:
severity: warning
namespace: ns-2
pod: pod-1
phase: Unknown
source_cluster: cluster02
exp_annotations:
summary: >-
Pod pod-1 is not ready
description: >-
Pod pod-1 in namespace ns-2 on cluster cluster02 is
not ready for more than 30 minutes.
alert_routing_key: ns-2
runbook_url: https://gitlab.cee.redhat.com/konflux/docs/sop/-/blob/main/o11y/alert-rule-PodNotReady.md
- interval: 1m
input_series:
# Pod is in the Failed state and scheduled, so it will be alerted.
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-3", phase="Pending", source_cluster="cluster03"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-3", phase="Unknown", source_cluster="cluster03"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-3", phase="Failed", source_cluster="cluster03"}'
values: '1x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-3", phase="Running", source_cluster="cluster03"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-3", phase="Succeeded", source_cluster="cluster03"}'
values: '0x29'
- series: 'kube_pod_status_unschedulable{namespace="ns-3", pod="pod-1", source_cluster="cluster03"}'
values: '0x29'
alert_rule_test:
- eval_time: 30m
alertname: PodNotReady
exp_alerts:
- exp_labels:
severity: warning
namespace: ns-3
pod: pod-1
phase: Failed
source_cluster: cluster03
exp_annotations:
summary: >-
Pod pod-1 is not ready
description: >-
Pod pod-1 in namespace ns-3 on cluster cluster03 is
not ready for more than 30 minutes.
alert_routing_key: ns-3
runbook_url: https://gitlab.cee.redhat.com/konflux/docs/sop/-/blob/main/o11y/alert-rule-PodNotReady.md
- interval: 1m
input_series:
# Not Alerted cases:
# Pod is in the Unknown state and unscheduled (unscheduled once in the 15 min
# interval), so it will not be alerted.
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-4", phase="Pending", source_cluster="cluster04"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-4", phase="Unknown", source_cluster="cluster04"}'
values: '1x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-4", phase="Failed", source_cluster="cluster04"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-4", phase="Running", source_cluster="cluster04"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-4", phase="Succeeded", source_cluster="cluster04"}'
values: '0x29'
- series: 'kube_pod_status_unschedulable{namespace="ns-4", pod="pod-1", source_cluster="cluster04"}'
values: '1x0 0x28'
# Pod is in Succeeded state and scheduled, so it will not be alerted.
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-5", phase="Pending"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-5", phase="Unknown"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-5", phase="Failed"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-5", phase="Running"}'
values: '0x29'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-5", phase="Succeeded"}'
values: '1x29'
- series: 'kube_pod_status_unschedulable{namespace="ns-5", pod="pod-1", source_cluster="cluster05"}'
values: '0x29'
# Pod is in the Running state for the first 14 min, then it's in the Failed state
# for the last 1 min and unscheduled, so it will not be alerted.
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-7", phase="Running"}'
values: '1x28 0'
- series: 'kube_pod_status_phase{pod="pod-1", namespace="ns-7", phase="Failed"}'
values: '0x28 1'
- series: 'kube_pod_status_unschedulable{namespace="ns-7", pod="pod-1",source_cluster="cluster05"}'
values: '0x29'
# Pod is in the Failed state and scheduled, but it has a namespace that ends
# with 'tenant' so it's ignored.
- series: 'kube_pod_status_phase{pod="pod-1", namespace="prod-tenant", phase="Failed"}'
values: '1x29'
- series: 'kube_pod_status_unschedulable{namespace="prod-tenant", pod="pod-1", source_cluster="cluster06"}'
values: '0x29'
# Pod is in the Pending state and scheduled, but it has a namespace that starts
# with 'openshift' so it's ignored.
- series: 'kube_pod_status_phase{pod="pod-2", namespace="openshift-prod-test", phase="Pending"}'
values: '1x29'
- series: 'kube_pod_status_unschedulable{namespace="openshift-prod-test", pod="pod-2", source_cluster="cluster07"}'
values: '0x29'
# Pod is in the Pending state and scheduled, but it has a namespace that starts
# with 'kube' so it's ignored.
- series: 'kube_pod_status_phase{pod="pod-3", namespace="kube-test", phase="Unknown"}'
values: '1x29'
- series: 'kube_pod_status_unschedulable{namespace="kube-test", pod="pod-3", source_cluster="cluster08"}'
values: '0x29'
# Pod is in the Pending state and scheduled, but it has a namespace 'default'
# so it's ignored.
- series: 'kube_pod_status_phase{pod="pod-4", namespace="default", phase="Failed"}'
values: '1x29'
- series: 'kube_pod_status_unschedulable{namespace="default", pod="pod-4", source_cluster="cluster09"}'
values: '0x29'
# Pod is in the Failed state and scheduled, but it has a namespace that ends with 'env' so it's ignored.
- series: 'kube_pod_status_phase{pod="test-pod", namespace="test-env", phase="Failed"}'
values: '1x29'
- series: 'kube_pod_status_unschedulable{namespace="test-env", pod="test-pod", source_cluster="cluster01"}'
values: '0x29'
# Pod is in the Failed state and scheduled, but it's in the 'tekton-ci' namespace so it's ignored.
- series: 'kube_pod_status_phase{pod="test-pod", namespace="tekton-ci", phase="Failed"}'
values: '1x29'
- series: 'kube_pod_status_unschedulable{namespace="tekton-ci", pod="test-pod", source_cluster="cluster01"}'
values: '0x29'
# Pod is in the Failed state and scheduled, but it's in the 'build-templates-e2e' namespace so it's ignored.
- series: 'kube_pod_status_phase{pod="test-pod", namespace="build-templates-e2e", phase="Failed"}'
values: '1x29'
- series: 'kube_pod_status_unschedulable{namespace="build-templates-e2e", pod="test-pod", source_cluster="cluster01"}'
values: '0x29'
# Pod is in the Failed state and scheduled, but it's in the 'konflux-ci' namespace so it's ignored.
- series: 'kube_pod_status_phase{pod="test-pod", namespace="konflux-ci", phase="Failed"}'
values: '1x29'
- series: 'kube_pod_status_unschedulable{namespace="konflux-ci", pod="test-pod", source_cluster="cluster01"}'
values: '0x29'
alert_rule_test:
- eval_time: 30m
alertname: PodNotReady