{{- if (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PrometheusRule") }} --- apiVersion: "monitoring.coreos.com/v1" kind: "PrometheusRule" metadata: name: flux-system labels: {{- toYaml .Values.commons.prometheus.rules.labels | nindent 4 }} spec: groups: - name: "FluxCD" rules: - alert: "FluxCD: source fetch failed" expr: 'gotk_reconcile_condition{status="False",kind=~"GitRepository|HelmRepository|Bucket"} > 0' for: "5m" labels: severity: "warning" {{` annotations: summary: "FluxCD has not fetched a source in {{ $labels.exported_namespace }} correct" description: "FluxCD has not fetched the source {{ $labels.name }} of {{ $labels.kind }} in {{ $labels.exported_namespace }}" `}} - alert: "FluxCD: install failed" expr: 'gotk_reconcile_condition{status="False",kind=~"Kustomization|HelmRelease"} > 0' for: "5m" labels: severity: "warning" {{` annotations: summary: "FluxCD has not installed something in {{ $labels.exported_namespace }} correct" description: "FluxCD has not installed {{ $labels.name }} of {{ $labels.kind }} in {{ $labels.exported_namespace }} correct" `}} {{- end }}