Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alert ClusterCrossplaneResourcesNotReady for Crossplane resources that are critical for clusters #1482

Merged
merged 3 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add alert `ClusterCrossplaneResourcesNotReady` for Crossplane resources that are critical for clusters

### Fixed

- fix capi-kubeadmconfig rule for hybrid providers
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
name: cluster-crossplane.rules
namespace: {{ .Values.namespace }}
spec:
groups:
- name: cluster-crossplane
rules:
- alert: ClusterCrossplaneResourcesNotReady
annotations:
# Crossplane doesn't offer object names and the objects are stored on the MC, so right
# now (2025-01), we can't make this alert WC-specific.
description: '{{`Not all managed Crossplane resources of type "{{ $labels.gvk }}" on {{ $labels.cluster_id }} are ready. This could affect creation or health of workload clusters.`}}'
opsrecipe: cluster-crossplane-resources
# Match critical resources deployed by cluster-aws via aws-nth-crossplane-resources,
# cilium-crossplane-resources, ...
expr: crossplane_managed_resource_exists{gvk=~".*Kind=(Queue|QueuePolicy|Role|Rule|SecurityGroup|SecurityGroupEgressRule|SecurityGroupIngressRule|Target)"} != crossplane_managed_resource_ready{gvk=~".*Kind=(Queue|QueuePolicy|Role|Rule|SecurityGroup|SecurityGroupEgressRule|SecurityGroupIngressRule|Target)"}
for: 15m
labels:
area: kaas
cancel_if_cluster_status_creating: "true"
cancel_if_cluster_status_deleting: "true"
cancel_if_cluster_status_updating: "true"
cancel_if_outside_working_hours: {{ include "workingHoursOnly" . }}
severity: page
team: phoenix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
rule_files:
- cluster-crossplane.rules.yml

tests:
- interval: 1m
input_series:
- series: 'crossplane_managed_resource_exists{gvk="cloudwatchevents.aws.upbound.io/v1beta1, Kind=Rule", cluster_id="mymc"}'
values: "6x20"
- series: 'crossplane_managed_resource_ready{gvk="cloudwatchevents.aws.upbound.io/v1beta1, Kind=Rule", cluster_id="mymc"}'
values: "5x20"

alert_rule_test:
- alertname: ClusterCrossplaneResourcesNotReady
eval_time: 20m
exp_alerts:
- exp_labels:
area: kaas
cancel_if_cluster_status_creating: "true"
cancel_if_cluster_status_deleting: "true"
cancel_if_cluster_status_updating: "true"
cancel_if_outside_working_hours: "false"
cluster_id: "mymc"
gvk: "cloudwatchevents.aws.upbound.io/v1beta1, Kind=Rule"
severity: page
team: phoenix
exp_annotations:
description: 'Not all managed Crossplane resources of type "cloudwatchevents.aws.upbound.io/v1beta1, Kind=Rule" on mymc are ready. This could affect creation or health of workload clusters.'
opsrecipe: cluster-crossplane-resources