forked from openshift/cluster-kube-apiserver-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi-usage.yaml
38 lines (37 loc) · 2.22 KB
/
api-usage.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
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: api-usage
namespace: openshift-kube-apiserver
spec:
groups:
- name: pre-release-lifecycle
rules:
- alert: APIRemovedInNextReleaseInUse
annotations:
summary: Deprecated API that will be removed in the next version is being used.
description: >-
Deprecated API that will be removed in the next version is being used. Removing the workload that is using
the {{ $labels.group }}.{{ $labels.version }}/{{ $labels.resource }} API might be necessary for
a successful upgrade to the next cluster version.
Refer to `oc get apirequestcounts {{ $labels.resource }}.{{ $labels.version }}.{{ $labels.group }} -o yaml` to identify the workload.
expr: |
group(apiserver_requested_deprecated_apis{removed_release="1.26"}) by (group,version,resource) and (sum by(group,version,resource) (rate(apiserver_request_total{system_client!="kube-controller-manager",system_client!="cluster-policy-controller"}[4h]))) > 0
for: 1h
labels:
namespace: openshift-kube-apiserver
severity: info
- alert: APIRemovedInNextEUSReleaseInUse
annotations:
summary: Deprecated API that will be removed in the next EUS version is being used.
description: >-
Deprecated API that will be removed in the next EUS version is being used. Removing the workload that is using
the {{ $labels.group }}.{{ $labels.version }}/{{ $labels.resource }} API might be necessary for
a successful upgrade to the next EUS cluster version.
Refer to `oc get apirequestcounts {{ $labels.resource }}.{{ $labels.version }}.{{ $labels.group }} -o yaml` to identify the workload.
expr: |
group(apiserver_requested_deprecated_apis{removed_release=~"1\\.2[67]"}) by (group,version,resource) and (sum by(group,version,resource) (rate(apiserver_request_total{system_client!="kube-controller-manager",system_client!="cluster-policy-controller"}[4h]))) > 0
for: 1h
labels:
namespace: openshift-kube-apiserver
severity: info