From 44b43557f9b142e87396039903b95aff8b2b5225 Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Tue, 12 Jul 2022 16:43:28 +0200 Subject: [PATCH] helm: add labels and annotations to PrometheusRule Signed-off-by: Mathieu Parent --- .../Helm-Charts/ceph-cluster-chart.md | 34 ++++++++++--------- .../templates/prometheusrules.yaml | 7 ++++ deploy/charts/rook-ceph-cluster/values.yaml | 4 +++ 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/Documentation/Helm-Charts/ceph-cluster-chart.md b/Documentation/Helm-Charts/ceph-cluster-chart.md index 1f4346d00..051d6c185 100644 --- a/Documentation/Helm-Charts/ceph-cluster-chart.md +++ b/Documentation/Helm-Charts/ceph-cluster-chart.md @@ -52,22 +52,24 @@ helm install --create-namespace --namespace rook-ceph rook-ceph-cluster \ The following tables lists the configurable parameters of the rook-operator chart and their default values. -| Parameter | Description | Default | -| ---------------------------------- | ------------------------------------------------------------------------------------------ | --------------- | -| `operatorNamespace` | Namespace of the Rook Operator | `rook-ceph` | -| `kubeVersion` | Optional override of the target kubernetes version | `` | -| `configOverride` | Cluster ceph.conf override | `` | -| `toolbox.enabled` | Enable Ceph debugging pod deployment. See [toolbox](../Troubleshooting/ceph-toolbox.md) | `false` | -| `toolbox.tolerations` | Toolbox tolerations | `[]` | -| `toolbox.affinity` | Toolbox affinity | `{}` | -| `toolbox.resources` | Toolbox resources | see values.yaml | -| `monitoring.enabled` | Enable Prometheus integration, will also create necessary RBAC rules | `false` | -| `monitoring.createPrometheusRules` | Whether to create the Prometheus rules for Ceph alerts | `false` | -| `cephClusterSpec.*` | Cluster configuration, see below | See below | -| `ingress.dashboard` | Enable an ingress for the ceph-dashboard | `{}` | -| `cephBlockPools.[*]` | A list of CephBlockPool configurations to deploy | See below | -| `cephFileSystems.[*]` | A list of CephFileSystem configurations to deploy | See below | -| `cephObjectStores.[*]` | A list of CephObjectStore configurations to deploy | See below | +| Parameter | Description | Default | +| --------------------------------------- | ------------------------------------------------------------------------------------------ | --------------- | +| `operatorNamespace` | Namespace of the Rook Operator | `rook-ceph` | +| `kubeVersion` | Optional override of the target kubernetes version | `` | +| `configOverride` | Cluster ceph.conf override | `` | +| `toolbox.enabled` | Enable Ceph debugging pod deployment. See [toolbox](../Troubleshooting/ceph-toolbox.md) | `false` | +| `toolbox.tolerations` | Toolbox tolerations | `[]` | +| `toolbox.affinity` | Toolbox affinity | `{}` | +| `toolbox.resources` | Toolbox resources | see values.yaml | +| `monitoring.enabled` | Enable Prometheus integration, will also create necessary RBAC rules | `false` | +| `monitoring.createPrometheusRules` | Whether to create the Prometheus rules for Ceph alerts | `false` | +| `monitoring.prometheusRule.labels` | Labels applied to PrometheusRule | `false` | +| `monitoring.prometheusRule.annotations` | Annotations applied to PrometheusRule | `false` | +| `cephClusterSpec.*` | Cluster configuration, see below | See below | +| `ingress.dashboard` | Enable an ingress for the ceph-dashboard | `{}` | +| `cephBlockPools.[*]` | A list of CephBlockPool configurations to deploy | See below | +| `cephFileSystems.[*]` | A list of CephFileSystem configurations to deploy | See below | +| `cephObjectStores.[*]` | A list of CephObjectStore configurations to deploy | See below | ### **Ceph Cluster Spec** diff --git a/deploy/charts/rook-ceph-cluster/templates/prometheusrules.yaml b/deploy/charts/rook-ceph-cluster/templates/prometheusrules.yaml index 09768359b..84ee230a7 100644 --- a/deploy/charts/rook-ceph-cluster/templates/prometheusrules.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/prometheusrules.yaml @@ -7,6 +7,13 @@ metadata: labels: prometheus: rook-prometheus role: alert-rules +{{- if .Values.monitoring.prometheusRule.labels }} +{{ toYaml .Values.monitoring.prometheusRule.labels | indent 4 }} +{{- end }} +{{- if .Values.monitoring.prometheusRule.annotations }} + annotations: +{{ toYaml .Values.monitoring.prometheusRule.annotations | indent 4 }} +{{- end }} name: prometheus-ceph-rules namespace: {{ default .Release.Namespace .Values.monitoring.rulesNamespaceOverride }} spec: diff --git a/deploy/charts/rook-ceph-cluster/values.yaml b/deploy/charts/rook-ceph-cluster/values.yaml index 008cb55fd..f64e8a952 100644 --- a/deploy/charts/rook-ceph-cluster/values.yaml +++ b/deploy/charts/rook-ceph-cluster/values.yaml @@ -47,6 +47,10 @@ monitoring: # Monitoring settings for external clusters: # externalMgrEndpoints: # externalMgrPrometheusPort: + # allow adding custom labels and annotations to the prometheus rule + prometheusRule: + labels: {} + annotations: {} # If true, create & use PSP resources. Set this to the same value as the rook-ceph chart. pspEnable: true