-
Notifications
You must be signed in to change notification settings - Fork 236
Open
Description
Hello I have created a bunch of Alert rules (for Grafana) in the form of a configmap:
kind: ConfigMap
apiVersion: v1
metadata:
name: thanos-ruler-custom-rules
namespace: open-cluster-management-observability
annotations:
argocd.argoproj.io/sync-wave: "2"
data:
custom_rules.yaml: |
groups:
- name: app-XXXXX
rules:
- alert: XXXRefreshXX
annotations:
description: "TEST TESTXXXXX {{ $labels.zoneId }} {{ $labels.cluster }}"
summary: "EPC Refresh rate above 7s for more than 1 minute."
runbook_url: bitbucket-xxx.com/projects/XXX/rXXXXXX/k8s/argocd/overlay/env/XXXXrunbook.md
dashboard_url: "grafana-xxx.com/d/bey8yi92day2oe/XXXXX=1&from=now-1h&to=now&timezone=XXX%2FLondon&var-cluster=$__all&var-envname=XXXXr&var-App=$__all&var-Filters=&var-XXX=$__all&refresh=1m&actionView=breakdown&var-groupby=app_type&metricPrefix=all&viewPanel=panel-886"
expr: max by (zoneId, cluster)(zone_cache_update_times_seconds_max) > 5
for: 1m
labels:
severity: critical
ServiceType: "App XXX"
This DOES WORK. My problem is I need to promote this configmap into many different environments.
So currently the runbook and dashboard URLs are both hardcoded. Is there a way to use Kustomize to painlessly substitute these URLs?
I have experimented with patchstrategicmerge locally, but it is a pain. It seems there is no "elegant" way to replace them strings. I have tried using replacement and it does not work well at all, and I fell down a rabbit hole experimenting with delimiters and replacements.
No good. PLease halp!
Metadata
Metadata
Assignees
Labels
No labels