Import Custom Dashboards¶
By using Grafana CRD, you can incorporate the management and deployment of dashboards into the lifecycle management of Kubernetes. This enables version control, automated deployment, and cluster-level management of dashboards. This page describes how to import custom dashboards using CRD and the UI interface.
Steps¶
-
Log in to the DCE 5.0 platform and go to Container Management . Select the kpanda-global-cluster from the cluster list.
-
Choose Custom Resources from the left navigation bar. Look for the grafana.integreatly.org file in the list and click it to view the details.
-
Click YAML Create and use the following template. Replace the dashboard JSON in the Json field.
-
namespace :填写目标命名空间;
- name :填写仪表盘的名称。
- spec.allowCrossNamespaceImport :必填,值为 true 。
-
spec.instanceSelector.matchLabels :必填,operator.insight.io/managed-by: insight 。
apiVersion: grafana.integreatly.org/v1beta1 kind: GrafanaDashboard metadata: labels: app: insight-grafana-operator name: sample-dashboard namespace: insight-system spec: allowCrossNamespaceImport: true instanceSelector: matchLabels: operator.insight.io/managed-by: insight json: > { "id": null, "title": "Simple Dashboard", "tags": [], "style": "dark", "timezone": "browser", "editable": true, "hideControls": false, "graphTooltip": 1, "panels": [], "time": { "from": "now-6h", "to": "now" }, "timepicker": { "time_options": [], "refresh_intervals": [] }, "templating": { "list": [] }, "annotations": { "list": [] }, "refresh": "5s", "schemaVersion": 17, "version": 0, "links": [] } -
After clicking OK , wait for a while to view the newly imported dashboard in Dashboard .
Info
If you need to customize the dashboard, refer to Add Dashboard Panel.