Deploying custom dashboards to Kloudfuse grafana server

Kloudfuse install/upgrade will provision a set of dashboards, this guide is mainly for users who want to deploy their own dashboards to the Kloudfuse grafana instance. This will also ensure that the custom dashboards persist across upgrades.

As a prerequisite, you should’ve run helm pull --untar of Kloudfuse release you wish to install/upgrade. The steps for this are documented in this guide. Once this command is run, the release is usually untarred to a directory called kfuse.

This document will use sock-shop.json as a sample dashboard. This is only an example, you should replace the name in all code snippets with the name of the dashboard you wish to import.

  • Create a directory called dashboards in the kfuse directory. Copy the dashboard json(s) into this folder. For example, copy sock-shop.json into kfuse/dashboards folder.

  • Create a template file (of kind ConfigMap) in kfuse/templates directory. For more information on the structure of templates directory, check out this page.

    # 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 }}

You’ll need to create a template file for each dashboard json you wish to import.

  • Update your custom values.yaml file with the custom dashboard(s) as dashboard providers. You’ll need to add it under grafana section in the custom values.yaml. For instance, for sock-shop dashboard you’ll need to update values.yaml as:

# 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' orgId: 1 folder: <folderName> type: file disableDeletion: true editable: false options: path: /var/lib/grafana/dashboards/sock-shop dashboardsConfigMaps: sock-shop: sock-shop-dashboard

Ensure that the providers.name, providers.options.path are updated correctly to match the dashboard json you’re importing. providers.folder is an additional option which will install the dashboard in the specified folder. By default, grafana installs all dashboards in General folder.