From da38bbf03087b4656b4878bb724014d34b0d43f2 Mon Sep 17 00:00:00 2001 From: Marit Iren Date: Mon, 24 Jun 2024 11:49:25 +0200 Subject: [PATCH 1/3] add section on setting up Grafana dashboard using the Grafana Helm Chart From the Grafana spec: https://github.com/grafana/helm-charts/blob/grafana-8.0.2/charts/grafana/values.yaml#L708-L759 --- docs/tutorials/grafana-dashboard.md | 41 ++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/docs/tutorials/grafana-dashboard.md b/docs/tutorials/grafana-dashboard.md index 9e0d7cfe5..4e161c17c 100644 --- a/docs/tutorials/grafana-dashboard.md +++ b/docs/tutorials/grafana-dashboard.md @@ -186,8 +186,13 @@ sum(trivy_image_exposedsecrets) ### Set up Grafana Dashboard for Trivy Operator Metrics Lastly, we want to visualise the security issues within our cluster in a Grafana Dashboard. +You can either do that manually in Grafana, or through the Helm Chart. -For this, navigate to the Grafana URL http://localhost:3000. +The link to the dashboard in Grafana is [the following.](https://grafana.com/grafana/dashboards/17813) + +#### Manually in Grafana + +Navigate to the Grafana URL http://localhost:3000. Username: admin Password: prom-operator @@ -200,8 +205,36 @@ Once you see all the default Dashboards, click `New`, then `Import`. Here, we will paste the ID of the Aqua Trivy Dashboard: `17813` -The link to the dashboard in Grafana is [the following.](https://grafana.com/grafana/dashboards/17813) - -Once pasted, you should see the following Dashboard as part of your Dashboard list: `Trivy Operator Dashboard` +Once pasted, you should see the following dashboard as part of your Dashboard list: `Trivy Operator Dashboard` + + +#### Using the Helm Chart + +The Grafana Helm chart supports importing the dashboard. To import the dashbaord using the ID, the Helm chart requires both a dashboard provider, as well as the dashboard itself as shown in the snippet below. +In the [Grafana Helm chart documentation](https://github.com/grafana/helm-charts/tree/main/charts/grafana#import-dashboards), you find examples of importing a dashboard with the dashboard ID. + +```yaml +grafana: + dashboardProviders: + dashboardproviders.yaml: + apiVersion: 1 + providers: + - name: '' + orgId: 1 + folder: '' + type: file + disableDeletion: false + editable: false + options: + path: /var/lib/grafana/dashboards/default + dashboards: + default: + trivy-operator-dashboard: + gnetId: 17813 + revision: 2 + datasource: Prometheus +``` + +When the Helm Chart has been applied, you should see the dashboard as part of your Dashboard list. It is named `Trivy Operator Dashboard`. ![Trivy Operator Dashbaord in Grafana Screenshot](../images/trivy-grafana.png) From 64acd18e0f9238e078b849503b502348a59b4bd0 Mon Sep 17 00:00:00 2001 From: Marit Iren Date: Mon, 24 Jun 2024 12:03:34 +0200 Subject: [PATCH 2/3] correct text --- docs/tutorials/grafana-dashboard.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/grafana-dashboard.md b/docs/tutorials/grafana-dashboard.md index 4e161c17c..0a6bc2f7b 100644 --- a/docs/tutorials/grafana-dashboard.md +++ b/docs/tutorials/grafana-dashboard.md @@ -186,7 +186,7 @@ sum(trivy_image_exposedsecrets) ### Set up Grafana Dashboard for Trivy Operator Metrics Lastly, we want to visualise the security issues within our cluster in a Grafana Dashboard. -You can either do that manually in Grafana, or through the Helm Chart. +You can either do that manually in Grafana, or using the Helm chart. The link to the dashboard in Grafana is [the following.](https://grafana.com/grafana/dashboards/17813) @@ -235,6 +235,6 @@ grafana: datasource: Prometheus ``` -When the Helm Chart has been applied, you should see the dashboard as part of your Dashboard list. It is named `Trivy Operator Dashboard`. +When the Helm chart has been applied, you should see the dashboard as part of your Dashboard list. It is named `Trivy Operator Dashboard`. ![Trivy Operator Dashbaord in Grafana Screenshot](../images/trivy-grafana.png) From e93f5ff9b60f0de1073e4524b85548d25a04ecde Mon Sep 17 00:00:00 2001 From: Marit Iren Date: Tue, 25 Jun 2024 10:07:40 +0200 Subject: [PATCH 3/3] clarify which Helm chart --- docs/tutorials/grafana-dashboard.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/grafana-dashboard.md b/docs/tutorials/grafana-dashboard.md index 0a6bc2f7b..ec9399db3 100644 --- a/docs/tutorials/grafana-dashboard.md +++ b/docs/tutorials/grafana-dashboard.md @@ -186,7 +186,7 @@ sum(trivy_image_exposedsecrets) ### Set up Grafana Dashboard for Trivy Operator Metrics Lastly, we want to visualise the security issues within our cluster in a Grafana Dashboard. -You can either do that manually in Grafana, or using the Helm chart. +You can either do that manually in Grafana, or using the Grafana Helm chart. The link to the dashboard in Grafana is [the following.](https://grafana.com/grafana/dashboards/17813) @@ -208,7 +208,7 @@ Here, we will paste the ID of the Aqua Trivy Dashboard: `17813` Once pasted, you should see the following dashboard as part of your Dashboard list: `Trivy Operator Dashboard` -#### Using the Helm Chart +#### Using the Grafana Helm Chart The Grafana Helm chart supports importing the dashboard. To import the dashbaord using the ID, the Helm chart requires both a dashboard provider, as well as the dashboard itself as shown in the snippet below. In the [Grafana Helm chart documentation](https://github.com/grafana/helm-charts/tree/main/charts/grafana#import-dashboards), you find examples of importing a dashboard with the dashboard ID.