forked from Kuadrant/kuadrant-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add alerts for TLS/DNS policies not targeting Gateways
- Loading branch information
1 parent
4f6a138
commit 606a52b
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: policies-missing | ||
namespace: monitoring | ||
spec: | ||
groups: | ||
- name: policy-rules | ||
rules: | ||
- alert: GatewayWithoutDnsPolicy | ||
expr: | | ||
label_replace(gatewayapi_gateway_info, "gateway_name", "$1", "name", "(.*)") unless | ||
(label_replace(gatewayapi_gateway_info, "gateway_name", "$1", "name", "(.*)") | ||
* on(gateway_name) group_left | ||
label_replace(gatewayapi_dnspolicy_target_info{target_kind="Gateway"}, "gateway_name", "$1", "target_name", "(.*)")) | ||
for: 5m | ||
labels: | ||
severity: warning | ||
annotations: | ||
summary: "No DNSPolicy targeting Gateway '{{ $labels.gateway_name }}'" | ||
description: "This alert fires if a gateway does not have an associated DNSPolicy." | ||
- alert: GatewayWithoutTlsPolicy | ||
expr: | | ||
label_replace(gatewayapi_gateway_info, "gateway_name", "$1", "name", "(.*)") unless | ||
(label_replace(gatewayapi_gateway_info, "gateway_name", "$1", "name", "(.*)") | ||
* on(gateway_name) group_left | ||
label_replace(gatewayapi_tlspolicy_target_info{target_kind="Gateway"}, "gateway_name", "$1", "target_name", "(.*)")) | ||
for: 5m | ||
labels: | ||
severity: warning | ||
annotations: | ||
summary: "No TLSPolicy targeting Gateway '{{ $labels.gateway_name }}'" | ||
description: "This alert fires if a gateway does not have an associated TLSPolicy." |