Skip to content

Commit

Permalink
replace mimir.enabled property with mc provider flavor as mimir is ev…
Browse files Browse the repository at this point in the history
…erywhere in capi (#1424)

* replace mimir.enabled property with mc provider flavor as mimir is everywhere in capi

* Update test/conf/providers
  • Loading branch information
QuentinBisson authored Nov 12, 2024
1 parent f01631d commit de44204
Show file tree
Hide file tree
Showing 69 changed files with 1,261 additions and 556 deletions.
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]

### Removed

- Remove the `mimir.enabled` property to replace it with the MC flavor as all CAPI MCs now run Mimir.

## [4.24.1] - 2024-11-12

### Fixed
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ There are 2 kinds of tests on rules:
```
[...]
### Testing platform/atlas/alerting-rules/prometheus-operator.rules.yml
### promtool check rules /home/marie/github-repo/prometheus-rules/test/hack/output/generated/capi/capa-mimir/platform/atlas/alerting-rules/prometheus-operator.rules.yml
### promtool check rules /home/marie/github-repo/prometheus-rules/test/hack/output/generated/capi/capa/platform/atlas/alerting-rules/prometheus-operator.rules.yml
### Skipping platform/atlas/alerting-rules/prometheus-operator.rules.yml: listed in test/conf/promtool_ignore
### Testing platform/atlas/alerting-rules/prometheus.rules.yml
### promtool check rules /home/marie/github-repo/prometheus-rules/test/hack/output/generated/capi/capa-mimir/platform/atlas/alerting-rules/prometheus.rules.yml
### promtool test rules prometheus.rules.test.yml - capi/capa-mimir
### promtool check rules /home/marie/github-repo/prometheus-rules/test/hack/output/generated/capi/capa/platform/atlas/alerting-rules/prometheus.rules.yml
### promtool test rules prometheus.rules.test.yml - capi/capa
[...]
09:06:29 promtool: end (Elapsed time: 1s)
Congratulations! Prometheus rules have been promtool checked and tested
Expand Down
2 changes: 1 addition & 1 deletion helm/prometheus-rules/templates/alloy-rules-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "capi" }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
2 changes: 1 addition & 1 deletion helm/prometheus-rules/templates/alloy-rules.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "capi" }}
apiVersion: application.giantswarm.io/v1alpha1
kind: App
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "workload_cluster"
{{- end }}
{{- end }}
name: aws-load-balancer-controller.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "workload_cluster"
{{- end }}
{{- end }}
name: node.aws.workload-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "workload_cluster"
{{- end }}
name: aws.workload-cluster.rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
{{- end }}
name: capa.management-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ kind: PrometheusRule
metadata:
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
{{- end }}
name: irsa.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
{{- end }}
name: apiserver.management-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "workload_cluster"
{{- end }}
{{- end }}
name: apiserver.workload-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ kind: PrometheusRule
metadata:
labels:
{{- include "labels.common" . | nindent 4}}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
{{- end }}
name: capi.management-cluster.rules
namespace: {{.Values.namespace}}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
{{- end }}
name: certificate.management-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "workload_cluster"
{{- end }}
{{- end }}
name: certificate.workload-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "workload_cluster"
{{- end }}
{{- end }}
name: cluster-autoscaler.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
{{- end }}
name: etcd.management-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "workload_cluster"
{{- end }}
{{- end }}
name: etcd.workload-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
{{- end }}
name: etcdbackup.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
{{- end }}
name: inhibit.nodes.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
{{- end }}
name: management-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
{{- end }}
name: node.management-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "workload_cluster"
{{- end }}
{{- end }}
name: node.workload-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "workload_cluster"
{{- end }}
name: pods.core.rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
{{- end }}
name: core.storage.management-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "workload_cluster"
{{- end }}
{{- end }}
name: core.storage.workload-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "capi" }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
{{- end }}
name: deployment.management-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "workload_cluster"
{{- end}}
{{- end }}
name: deployment.workload-cluster.rules
namespace: {{ .Values.namespace }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: PrometheusRule
metadata:
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
name: grafana-cloud.rules
Expand All @@ -17,7 +17,7 @@ spec:
annotations:
description: 'Prometheus is not sending data to Grafana Cloud.'
opsrecipe: prometheus-grafanacloud/
{{- if .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "capi" }}
expr: absent(prometheus_remote_storage_samples_total{remote_name="grafana-cloud", cluster_type="management_cluster", cluster_id="{{ .Values.managementCluster.name }}", installation="{{ .Values.managementCluster.name }}", provider="{{ .Values.managementCluster.provider.kind }}", pipeline="{{ .Values.managementCluster.pipeline }}"})
{{- else }}
expr: absent(prometheus_remote_storage_samples_total{remote_name="grafana-cloud"})
Expand All @@ -29,7 +29,7 @@ spec:
severity: page
team: atlas
topic: observability
{{- if .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "capi" }}
- name: mimir-to-grafana-cloud-exporter
rules:
- alert: MimirToGrafanaCloudExporterDown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: PrometheusRule
metadata:
labels:
{{- include "labels.common" . | nindent 4 }}
{{- if not .Values.mimir.enabled }}
{{- if eq .Values.managementCluster.provider.flavor "vintage" }}
cluster_type: "management_cluster"
{{- end }}
name: grafana.rules
Expand Down
Loading

0 comments on commit de44204

Please sign in to comment.