From 679ddc7386286ae49c1aa865d5e69f05f274d3e8 Mon Sep 17 00:00:00 2001 From: Catherine Luse Date: Fri, 16 Apr 2021 18:50:23 -0700 Subject: [PATCH 1/6] Update persisent Grafana dashboard doc per Arvind's feedback --- .../v2.5/en/monitoring-alerting/_index.md | 2 +- .../persist-grafana/_index.md | 71 ++++++++++++------- 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/content/rancher/v2.5/en/monitoring-alerting/_index.md b/content/rancher/v2.5/en/monitoring-alerting/_index.md index c6d16e6d6e9..e4f3579e0aa 100644 --- a/content/rancher/v2.5/en/monitoring-alerting/_index.md +++ b/content/rancher/v2.5/en/monitoring-alerting/_index.md @@ -169,7 +169,7 @@ For more information on configuring Alertmanager in Rancher, see [this page.](./ **Result:** `rancher-monitoring` is uninstalled. -> **Note on Persistent Grafana Dashboards:** For users who are using Monitoring V2 v9.4.203 or below, uninstalling the Monitoring chart will delete the cattle-dashboards namespace, which will delete all persisted dashboards, unless the namespace is marked with the annotation `helm.sh/resource-policy: "keep"`. This annotation is added by default in Rancher v2.5.8+. +> **Note on Persistent Grafana Dashboards:** For users who are using Monitoring V2 v9.4.203 or below, uninstalling the Monitoring chart will delete the cattle-dashboards namespace, which will delete all persisted dashboards, unless the namespace is marked with the annotation `helm.sh/resource-policy: "keep"`. This annotation is added by default in Monitoring V2 v14.5.100+ but can be manually applied on the cattle-dashboards namespace before an uninstall if an older version of the Monitoring chart is currently installed onto your cluster. # Setting Resource Limits and Requests diff --git a/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md b/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md index 3a52281145f..94c8a1d183f 100644 --- a/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md +++ b/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md @@ -14,39 +14,60 @@ To allow the Grafana dashboard to persist after the Grafana instance restarts, a {{% tabs %}} {{% tab "Rancher v2.5.8+" %}} -> **Prerequisites:** -> -> - The monitoring application needs to be installed. -> - You must have at least the **Manage Config Maps** Rancher RBAC permissions assigned to you in the project or namespace that contains the Grafana Dashboards. This correlates to the `monitoring-dashboard-edit` or `monitoring-dashboard-admin` Kubernetes native RBAC Roles exposed by the Monitoring chart. +### Prerequisites + +- The monitoring application needs to be installed. +- You must have at least the **Manage Config Maps** Rancher RBAC permissions assigned to you in the project that contains the Grafana Dashboards namespace (e.g. cattle-dashboards by default). This correlates to the `monitoring-dashboard-edit` or `monitoring-dashboard-admin` Kubernetes native RBAC Roles exposed by the Monitoring chart. + +### 1. Get the JSON model of the dashboard that you want to persist + +To create a persistent dashboard, you will need to get the JSON model of the dashboard you want to persist. You can use a premade dashboard or build your own. + +To use a premade dashboard, go to [https://grafana.com/grafana/dashboards,](https://grafana.com/grafana/dashboards) open up its detail page, and click on the **Download JSON** button to get the JSON model for the next step. + +To use your own dashboard: 1. Open the Grafana dashboard. From the **Cluster Explorer,** click **Cluster Explorer > Monitoring.** -1. Log in to Grafana. Note: The default Admin username and password for the Grafana instance is `admin/prom-operator`. (Regardless of who has the password, the **Manage Config Maps** permission in Rancher is still required to access the Grafana instance.) Alternative credentials can also be supplied on deploying or upgrading the chart. -1. Go to the dashboard that you want to persist. In the top navigation menu, go to the dashboard settings by clicking the gear icon. -1. In the left navigation menu, click **JSON Model.** +1. Log in to Grafana. Note: The default Admin username and password for the Grafana instance is `admin/prom-operator`. (Regardless of who has the password, in order to access the Grafana instance, you still need at least the **Manage Services** or **View Monitoring** permissions in the Project containing the namespace that contains Grafana.) Alternative credentials can also be supplied on deploying or upgrading the chart. +1. Create a dashboard using Grafana's UI. Once complete, go to the dashboard's settings by clicking on the gear icon in the top navigation menu. In the left navigation menu, click **JSON Model.** 1. Copy the JSON data structure that appears. -1. Create a ConfigMap in the `cattle-dashboards` namespace. - Paste the JSON into the ConfigMap in the format shown in the example below: - ```yaml - apiVersion: v1 - kind: ConfigMap - metadata: - labels: - grafana_dashboard: "1" - name: - namespace: cattle-dashboards - data: - .json: |- - - ``` +### 2. Create a ConfigMap using the Grafana JSON model - > By default, Grafana is configured to watch all ConfigMaps with the `grafana_dashboard` label within the `cattle-dashboards` namespace. - > - > To specify that you would like Grafana to watch for ConfigMaps across all namespaces, refer to [this section.](#configuring-namespaces-for-the-grafana-dashboard-configmap) +Create a ConfigMap in the namespace that contains your Grafana Dashboards (e.g. cattle-dashboards by default). + +The ConfigMap should look like this: + +```yaml +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + grafana_dashboard: "1" + name: + namespace: cattle-dashboards # Change if using a non-default namespace +data: + .json: |- + +``` + +By default, Grafana is configured to watch all ConfigMaps with the `grafana_dashboard` label within the `cattle-dashboards` namespace. + +To specify that you would like Grafana to watch for ConfigMaps across all namespaces, refer to [this section.](#configuring-namespaces-for-the-grafana-dashboard-configmap) + +To create the ConfigMap in the Rancher UI, + +1. Go to the Cluster Explorer. +1. Click **Core > ConfigMaps.** +1. Click **Create.** +1. Set up the key-value pairs similar to the example above. When entering the value for `.json`, click **Read from File** to upload the JSON data model as the value. +1. Click **Create.** **Result:** After the ConfigMap is created, it should show up on the Grafana UI and be persisted even if the Grafana pod is restarted. -Dashboards that are persisted using ConfigMaps cannot be deleted from the Grafana UI. If you attempt to delete the dashboard in the Grafana UI, you will see the error message "Dashboard cannot be deleted because it was provisioned." To delete the dashboard, you will need to delete the ConfigMap. +Dashboards that are persisted using ConfigMaps cannot be deleted or edited from the Grafana UI. + +If you attempt to delete the dashboard in the Grafana UI, you will see the error message "Dashboard cannot be deleted because it was provisioned." To delete the dashboard, you will need to delete the ConfigMap. ### Configuring Namespaces for the Grafana Dashboard ConfigMap From 479968cd6986d2e56ea08557dd702208f28b46b2 Mon Sep 17 00:00:00 2001 From: Catherine Luse Date: Thu, 29 Apr 2021 12:24:21 -0700 Subject: [PATCH 2/6] Update content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md Co-authored-by: Arvind Iyengar --- .../v2.5/en/monitoring-alerting/persist-grafana/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md b/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md index 94c8a1d183f..0c9fd575bda 100644 --- a/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md +++ b/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md @@ -23,7 +23,7 @@ To allow the Grafana dashboard to persist after the Grafana instance restarts, a To create a persistent dashboard, you will need to get the JSON model of the dashboard you want to persist. You can use a premade dashboard or build your own. -To use a premade dashboard, go to [https://grafana.com/grafana/dashboards,](https://grafana.com/grafana/dashboards) open up its detail page, and click on the **Download JSON** button to get the JSON model for the next step. +To use a premade dashboard, go to [https://grafana.com/grafana/dashboards](https://grafana.com/grafana/dashboards), open up its detail page, and click on the **Download JSON** button to get the JSON model for the next step. To use your own dashboard: @@ -123,4 +123,4 @@ helm.sh/resource-policy: "keep" For users who are using Monitoring V2 v9.4.203 or below, uninstalling the Monitoring chart will delete the `cattle-dashboards` namespace, which will delete all persisted dashboards, unless the namespace is marked with the annotation `helm.sh/resource-policy: "keep"`. -This annotation will be added by default in the new monitoring chart released by Rancher v2.5.8, but it still needs to be manually applied for users of earlier Rancher versions. \ No newline at end of file +This annotation will be added by default in the new monitoring chart released by Rancher v2.5.8, but it still needs to be manually applied for users of earlier Rancher versions. From 17a2783392c27cfd559a583c48c62b9710bddda9 Mon Sep 17 00:00:00 2001 From: Catherine Luse Date: Thu, 29 Apr 2021 12:24:35 -0700 Subject: [PATCH 3/6] Update content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md Co-authored-by: Arvind Iyengar --- .../v2.5/en/monitoring-alerting/persist-grafana/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md b/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md index 0c9fd575bda..9e1adb094b2 100644 --- a/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md +++ b/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md @@ -27,7 +27,7 @@ To use a premade dashboard, go to [https://grafana.com/grafana/dashboards](https To use your own dashboard: -1. Open the Grafana dashboard. From the **Cluster Explorer,** click **Cluster Explorer > Monitoring.** +1. Click on the link to open Grafana. From the **Cluster Explorer,** click **Cluster Explorer > Monitoring.** 1. Log in to Grafana. Note: The default Admin username and password for the Grafana instance is `admin/prom-operator`. (Regardless of who has the password, in order to access the Grafana instance, you still need at least the **Manage Services** or **View Monitoring** permissions in the Project containing the namespace that contains Grafana.) Alternative credentials can also be supplied on deploying or upgrading the chart. 1. Create a dashboard using Grafana's UI. Once complete, go to the dashboard's settings by clicking on the gear icon in the top navigation menu. In the left navigation menu, click **JSON Model.** 1. Copy the JSON data structure that appears. From d6263edc1f978ce2a4c3c6ff72de96d75f2989d1 Mon Sep 17 00:00:00 2001 From: Catherine Luse Date: Fri, 30 Apr 2021 10:21:47 -0700 Subject: [PATCH 4/6] Update content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md Co-authored-by: Arvind Iyengar --- .../v2.5/en/monitoring-alerting/persist-grafana/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md b/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md index 9e1adb094b2..731da5c0daa 100644 --- a/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md +++ b/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md @@ -28,7 +28,7 @@ To use a premade dashboard, go to [https://grafana.com/grafana/dashboards](https To use your own dashboard: 1. Click on the link to open Grafana. From the **Cluster Explorer,** click **Cluster Explorer > Monitoring.** -1. Log in to Grafana. Note: The default Admin username and password for the Grafana instance is `admin/prom-operator`. (Regardless of who has the password, in order to access the Grafana instance, you still need at least the **Manage Services** or **View Monitoring** permissions in the Project containing the namespace that contains Grafana.) Alternative credentials can also be supplied on deploying or upgrading the chart. +1. Log in to Grafana. Note: The default Admin username and password for the Grafana instance is `admin/prom-operator`. (Regardless of who has the password, in order to access the Grafana instance, you still need at least the **Manage Services** or **View Monitoring** permissions in the Project that Rancher Monitoring is deployed into Alternative credentials can also be supplied on deploying or upgrading the chart.) 1. Create a dashboard using Grafana's UI. Once complete, go to the dashboard's settings by clicking on the gear icon in the top navigation menu. In the left navigation menu, click **JSON Model.** 1. Copy the JSON data structure that appears. From 27f90c0ea5144b9b89227e60fcc5d338dfdef028 Mon Sep 17 00:00:00 2001 From: Catherine Luse Date: Fri, 30 Apr 2021 10:23:23 -0700 Subject: [PATCH 5/6] Update content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md Co-authored-by: Arvind Iyengar --- .../v2.5/en/monitoring-alerting/persist-grafana/_index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md b/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md index 731da5c0daa..3702a54a326 100644 --- a/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md +++ b/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md @@ -58,10 +58,10 @@ To specify that you would like Grafana to watch for ConfigMaps across all namesp To create the ConfigMap in the Rancher UI, 1. Go to the Cluster Explorer. -1. Click **Core > ConfigMaps.** -1. Click **Create.** +1. Click **Core > ConfigMaps**. +1. Click **Create**. 1. Set up the key-value pairs similar to the example above. When entering the value for `.json`, click **Read from File** to upload the JSON data model as the value. -1. Click **Create.** +1. Click **Create**. **Result:** After the ConfigMap is created, it should show up on the Grafana UI and be persisted even if the Grafana pod is restarted. From 8e12f3c31bba90231ce21f35ccd2e796318d4d66 Mon Sep 17 00:00:00 2001 From: Catherine Luse Date: Fri, 30 Apr 2021 10:21:06 -0700 Subject: [PATCH 6/6] Fix note formatting on persistent Grafana docs --- .../v2.5/en/monitoring-alerting/persist-grafana/_index.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md b/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md index 3702a54a326..6544fcef650 100644 --- a/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md +++ b/content/rancher/v2.5/en/monitoring-alerting/persist-grafana/_index.md @@ -28,7 +28,9 @@ To use a premade dashboard, go to [https://grafana.com/grafana/dashboards](https To use your own dashboard: 1. Click on the link to open Grafana. From the **Cluster Explorer,** click **Cluster Explorer > Monitoring.** -1. Log in to Grafana. Note: The default Admin username and password for the Grafana instance is `admin/prom-operator`. (Regardless of who has the password, in order to access the Grafana instance, you still need at least the **Manage Services** or **View Monitoring** permissions in the Project that Rancher Monitoring is deployed into Alternative credentials can also be supplied on deploying or upgrading the chart.) +1. Log in to Grafana. Note: The default Admin username and password for the Grafana instance is `admin/prom-operator`. Alternative credentials can also be supplied on deploying or upgrading the chart. + + > **Note:** Regardless of who has the password, in order to access the Grafana instance, you still need at least the Manage Services or View Monitoring permissions in the project that Rancher Monitoring is deployed into. Alternative credentials can also be supplied on deploying or upgrading the chart. 1. Create a dashboard using Grafana's UI. Once complete, go to the dashboard's settings by clicking on the gear icon in the top navigation menu. In the left navigation menu, click **JSON Model.** 1. Copy the JSON data structure that appears. @@ -87,7 +89,9 @@ Note that the RBAC roles exposed by the Monitoring chart to add Grafana Dashboar > - You must have the cluster-admin ClusterRole permission. 1. Open the Grafana dashboard. From the **Cluster Explorer,** click **Cluster Explorer > Monitoring.** -1. Log in to Grafana. Note: The default Admin username and password for the Grafana instance is `admin/prom-operator`. (Regardless of who has the password, cluster administrator permission in Rancher is still required to access the Grafana instance.) Alternative credentials can also be supplied on deploying or upgrading the chart. +1. Log in to Grafana. Note: The default Admin username and password for the Grafana instance is `admin/prom-operator`. Alternative credentials can also be supplied on deploying or upgrading the chart. + + > **Note:** Regardless of who has the password, cluster administrator permission in Rancher is still required to access the Grafana instance. 1. Go to the dashboard that you want to persist. In the top navigation menu, go to the dashboard settings by clicking the gear icon. 1. In the left navigation menu, click **JSON Model.** 1. Copy the JSON data structure that appears.