- Navigate to the dashboard in Grafana
- Click blue "Share" button at the top
- Select the "Export" tab
- Click on "View JSON"
- Click "Copy to Clipboard"
- Create a new file in your repository and copy the following snippet into it:
apiVersion: v1
kind: ConfigMap
metadata:
name: my-awesome-dashboard
namespace: my-namespace
labels:
grafana_dashboard: "1"
data:
my-awesome-dashboard.json: |-
Then paste the copied dashboard JSON from the clipboard into this file. Make sure to indent it by 4 spaces like here:
data:
my-awesome-dashboard.json: |-
{
"annotations": {
...