@@ -1323,3 +1323,62 @@ tests:
1323
1323
description : ' Cluster has overcommitted memory resource requests for Namespaces.'
1324
1324
runbook_url : " https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubememoryquotaovercommit"
1325
1325
summary : " Cluster has overcommitted memory resource requests."
1326
+
1327
+ # Verify KubeStatefulSetReplicasMismatch fires, when no replicas could be created
1328
+ - interval : 1m
1329
+ name : StatefulSet replicas not created
1330
+ input_series :
1331
+ - series : ' kube_statefulset_replicas{cluster="kubernetes",namespace="test",job="kube-state-metrics",statefulset="sts"}'
1332
+ values : ' 3x15'
1333
+ - series : ' kube_statefulset_status_replicas{cluster="kubernetes",namespace="test",job="kube-state-metrics",statefulset="sts"}'
1334
+ values : ' 0x15'
1335
+ - series : ' kube_statefulset_status_replicas_ready{cluster="kubernetes",namespace="test",job="kube-state-metrics",statefulset="sts"}'
1336
+ values : ' 0x15'
1337
+ - series : ' kube_statefulset_status_replicas_updated{cluster="kubernetes",namespace="test",job="kube-state-metrics",statefulset="sts"}'
1338
+ values : ' 0x15'
1339
+ alert_rule_test :
1340
+ - eval_time : 14m
1341
+ alertname : KubeStatefulSetReplicasMismatch
1342
+ - eval_time : 15m
1343
+ alertname : KubeStatefulSetReplicasMismatch
1344
+ exp_alerts :
1345
+ - exp_labels :
1346
+ severity : " warning"
1347
+ job : " kube-state-metrics"
1348
+ cluster : " kubernetes"
1349
+ namespace : " test"
1350
+ statefulset : " sts"
1351
+ exp_annotations :
1352
+ description : " StatefulSet test/sts has not matched the expected number of replicas for longer than 15 minutes."
1353
+ runbook_url : " https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubestatefulsetreplicasmismatch"
1354
+ summary : " StatefulSet has not matched the expected number of replicas."
1355
+
1356
+ # Verify KubeStatefulSetReplicasMismatch fires, when replicas could be created but are not ready
1357
+ - interval : 1m
1358
+ name : StatefulSet replicas created but not ready
1359
+ input_series :
1360
+ - series : ' kube_statefulset_replicas{cluster="kubernetes",namespace="test",job="kube-state-metrics",statefulset="sts"}'
1361
+ values : ' 3x15'
1362
+ - series : ' kube_statefulset_status_replicas{cluster="kubernetes",namespace="test",job="kube-state-metrics",statefulset="sts"}'
1363
+ values : ' 3x15'
1364
+ - series : ' kube_statefulset_status_replicas_ready{cluster="kubernetes",namespace="test",job="kube-state-metrics",statefulset="sts"}'
1365
+ values : ' 0x15'
1366
+ - series : ' kube_statefulset_status_replicas_updated{cluster="kubernetes",namespace="test",job="kube-state-metrics",statefulset="sts"}'
1367
+ values : ' 0x15'
1368
+ alert_rule_test :
1369
+ - eval_time : 14m
1370
+ alertname : KubeStatefulSetReplicasMismatch
1371
+ - eval_time : 15m
1372
+ alertname : KubeStatefulSetReplicasMismatch
1373
+ exp_alerts :
1374
+ - exp_labels :
1375
+ severity : " warning"
1376
+ job : " kube-state-metrics"
1377
+ cluster : " kubernetes"
1378
+ namespace : " test"
1379
+ statefulset : " sts"
1380
+ exp_annotations :
1381
+ description : " StatefulSet test/sts has not matched the expected number of replicas for longer than 15 minutes."
1382
+ runbook_url : " https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubestatefulsetreplicasmismatch"
1383
+ summary : " StatefulSet has not matched the expected number of replicas."
1384
+
0 commit comments