Skip to content

Commit 9b26547

Browse files
Merge pull request #384 from jottofar/ota-189-alert-upgradeable-false
Add an alert to CVO that fires when cluster is not upgradeable
2 parents 692a8a3 + dadbf9e commit 9b26547

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

install/0000_90_cluster-version-operator_02_servicemonitor.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ spec:
5353
severity: critical
5454
- name: cluster-operators
5555
rules:
56+
- alert: ClusterNotUpgradeable
57+
annotations:
58+
message: One or more cluster operators have been blocking minor version cluster upgrades for at least an hour for reason {{ "{{ with $cluster_operator_conditions := \"cluster_operator_conditions\" | query}}{{range $value := .}}{{if and (eq (label \"name\" $value) \"version\") (eq (label \"condition\" $value) \"Upgradeable\") (eq (label \"endpoint\" $value) \"metrics\") (eq (value $value) 0.0) (ne (len (label \"reason\" $value)) 0) }}{{label \"reason\" $value}}.{{end}}{{end}}{{end}}"}} {{ "{{ with $console_url := \"console_url\" | query }}{{ if ne (len (label \"url\" (first $console_url ) ) ) 0}} For more information refer to {{ label \"url\" (first $console_url ) }}/settings/cluster/.{{ end }}{{ end }}" }}
59+
expr: |
60+
max by (name, condition, endpoint) (cluster_operator_conditions{name="version", condition="Upgradeable", endpoint="metrics"} == 0)
61+
for: 60m
62+
labels:
63+
severity: warning
5664
- alert: ClusterOperatorDown
5765
annotations:
5866
message: Cluster operator {{ "{{ $labels.name }}" }} has not been available for 10 minutes. Operator may be down or disabled, cluster will not be kept up to date and upgrades will not be possible.

0 commit comments

Comments
 (0)