Dashboards V2

While not natively supported by the GrafanaDashboard resource, dashboards using the new dashboard V2 schema can be provisioned using the GrafanaManifest resource.

To do this, wrap the dashboard in a GrafanaManifest under the spec.template field like in the example below:

apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaManifest
metadata:
  name: my-dashboard
spec:
  instanceSelector:
    matchLabels:
      instance: grafana
  template:
   apiVersion: dashboard.grafana.app/v2beta1
   kind: Dashboard
   metadata:
     name: my-dashboard
     # optional if using a Grafana instance managed by the operator or
     # if `tenantNamespace` is set in `spec.external` of the `Grafana` manifest
     namespace: stacks-10101
     annotations:
       "grafana.app/folder": "fxjtxj" # UID of the folder
       "grafana.app/folderUrl": "/dashboards/f/fxjtxj/containing-folder" # uid + folder slug
   spec:
     title: My dashboard
     annotations: []
     editable: false
     cursorSync: "Off"
     elements:
       panel-1:
         kind: Panel
         spec:
           id: 1
           title: Example Panel
           description: ""
           links: []
           data:
             kind: QueryGroup
             spec:
               queries: []
               transformations: []
               queryOptions: {}
           vizConfig:
             kind: VizConfig
             group: text
             version: 13.0.0-22888039840
             spec:
               options:
                 code:
                   language: plaintext
                   showLineNumbers: false
                   showMiniMap: false
                 content: Hello from v2!
                 mode: markdown
               fieldConfig:
                 defaults: {}
                 overrides: []
     layout:
       kind: GridLayout
       spec:
         items:
           - kind: GridLayoutItem
             spec:
               x: 0
               "y": 0
               width: 12
               height: 8
               element:
                 kind: ElementReference
                 name: panel-1

     links: []
     liveNow: false
     preload: false
     tags: []
     timeSettings:
       timezone: browser
       from: now-6h
       to: now
       autoRefresh: ""
       autoRefreshIntervals:
         - 5s
         - 10s
         - 30s
         - 1m
         - 5m
         - 15m
         - 30m
         - 1h
         - 2h
         - 1d
       hideTimepicker: false
       fiscalYearStartMonth: 0
     variables: []