Skip to content

Instantly share code, notes, and snippets.

@makkes
Created October 28, 2024 09:37
Show Gist options
  • Save makkes/ee672596b920a8c469ecc440a526468f to your computer and use it in GitHub Desktop.
Save makkes/ee672596b920a8c469ecc440a526468f to your computer and use it in GitHub Desktop.
Grafana Dashboard as ConfigMaps
  1. Navigate to the dashboard in Grafana
  2. Click blue "Share" button at the top
  3. Select the "Export" tab
  4. Click on "View JSON"
  5. Click "Copy to Clipboard"
  6. 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": {
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment