-
Notifications
You must be signed in to change notification settings - Fork 1
Change IsPlatformAlertRule implementation #1
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
Change IsPlatformAlertRule implementation #1
Conversation
| return ni, err | ||
| } | ||
|
|
||
| func namespaceListWatch(client corev1client.CoreV1Interface) *cache.ListWatch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe set a LabelSelector for openshift.io/cluster-monitoring=true to reduce watch/list volume
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch, thought i added it, but forgot
| ) | ||
|
|
||
| const ( | ||
| // ClusterMonitoringLabel is the label used to identify namespaces with cluster monitoring enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This label is used to define Platform alerts.
Alerts defined in a PrometheusRule in a namespace that has this label will be evaluated by the platform stack.
@machadovilaca This should say that we set the For |
2e122a4 to
24f4d76
Compare
not yet, next PR |
| } | ||
| ni.updateMonitoringNamespace(ns) | ||
| }, | ||
| DeleteFunc: func(obj interface{}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider checking also obj.(cache.DeletedFinalStateUnknown) in case of fast create and delete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: machadovilaca <machadovilaca@gmail.com>
24f4d76 to
3c503cb
Compare
This PR refactors how platform managed alert rules are identified in management API and Kubernetes client. It removes hard-coded namespace naming assumptionson platform namespace, and now relies on informers for to check the cluster monitoring label on the namespaces
https://issues.redhat.com/browse/CNV-71645