# Kloudfuse Grafana: Deploying Custom Dashboards

Kloudfuse install and upgrade provision a set of standard Grafana dashboards.

To deploy your own custom dashboards to the Kloudfuse-Grafana instance, follow these steps to ensure that the custom dashboards persist through upgrades.

## Prerequisites

1. Run a `helm pull --untar` command for the Kloudfuse release you plan to install or upgrade to.

2. Follow the steps in the [Installation](https://docs.kloudfuse.com/platform/3.5.0/installation/) section.

3. After completing the installation or upgrade, the files are in the `kfuse` directory.

|     |     |
| --- | --- |
|  | The rest of this document uses the sample dashboard `sock-shop.json`. Replace this name in all code snippets with the name of the dashboard you plan to import. |

## Configure Kloudfuse to Consume Dashboards

1. Create a `dashboards` directory in the `kfuse` directory.

2. Create a `templates` directory in the `kfuse` directory.

3. Copy the dashboard `*.json` files into the `kfuse/dashboards` directory.

4. For each dashboard you plan to import, create a template file of kind `ConfigMap`, in the `kfuse/templates` directory.

See Helm documentation for [Templates](https://helm.sh/docs/chart_best_practices/templates/).

```yaml
# sock-shop-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
     name: sock-shop-dashboard
     namespace: {{ .Release.Namespace }}
data:
     kloudfuse.json: |-
{{ .Files.Get "dashboards/sock-shop.json" | indent 4 }}
```

5. Update your `custom-values.yaml` file with custom dashboards as dashboard providers. Add them under the `grafana` section.

For example, this is how you would include the `sock-shop.json` dashboard in the `custom-values.yaml` file:

```yaml
# custom_values.yaml
# grafana - Configuration for the embedded Grafana included in Kfuse
grafana:
     grafana:
       fullnameOverride: "kfuse-grafana"
       nameOverride: "kfuse-grafana"
       # replicas - Specify the number of Grafana replicas to deploy
       replicas: 1
       dashboardProviders:
         dashboardproviders.yaml:
           apiVersion: 1
           providers:
          - name: 'sock-shop' (1)
            orgId: 1
            folder: <folderName> (2)
            type: file
            disableDeletion: true
            editable: false
            options:
              path: /var/lib/grafana/dashboards/sock-shop (3)
    dashboardsConfigMaps:
      sock-shop: sock-shop-dashboard
```

|     |     |
| --- | --- |
| **1** | `providers.name` must match the dashboard `*.json` |
| **2** | `providers.folder` is optional. By default, Grafana installs all dashboards in the `general` folder. |
| **3** | `providers.options.path` must match the dashboard `*.json` |
