Mirantis Container Cloud (MCC) becomes part of Mirantis OpenStack for Kubernetes (MOSK)!
Starting with MOSK 25.2, the MOSK documentation set covers all product layers, including MOSK management (formerly Container Cloud). This means everything you need is in one place. Some legacy names may remain in the code and documentation and will be updated in future releases. The separate Container Cloud documentation site will be retired, so please update your bookmarks for continued easy access to the latest content.
Create custom dashboards in Grafana¶
You can add custom dashboards either using the Grafana user interface (UI) or declaratively:
UI method: use the Import feature, which stores dashboards directly in the Grafana database. For details, see official Grafana documentation.
Declarative method: store dashboards as JSON in Kubernetes ConfigMaps, which allows version-controlled, GitOps-friendly dashboard management.
To add custom dashboards in Grafana declaratively:
Obtain the list of JSON file names accross all Grafana dashboard ConfigMaps:
kubectl get configmaps -n stacklight -l dashboard-provider=default -o json | jq -r '.items[].data | keys[]'
Example of system response:
alertmanager.json clusters-overview.json …
Obtain the list of all active dashboard titles and UIDs from the Grafana API:
kubectl exec -n stacklight deploy/grafana -c grafana -- \ curl -s "http://localhost:3000/api/search?type=dash-db" | \ jq -r '.[] | "title: \(.title) [uid: \(.uid)]"'
Example of system response:
title: Alertmanager [uid: ae5441xus40lca] title: Clusters Overview [uid: de5441y5vnrwgd] …
In the
stacklight
namespace, create a ConfigMap containing the JSON file with dashboard details.Important
Ensure that the following identifiers are unique across all Grafana dashboard ConfigMaps and do not conflict with existing identifiers verified in previous steps:
ConfigMap name
JSON file name
Dashboard title and UID inside JSON
Add the
dashboard-provider: default
label to the ConfigMap.Note
Removing this label from the ConfigMap removes the related Grafana dashboard.
Example ConfigMap for a custom Grafana dashboard:
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-dashboards-custom-myapp
namespace: stacklight
labels:
dashboard-provider: default
data:
myapp-overview.json: |
{
"editable": true,
"panels": [],
"time": {
"from": "now-1h",
"to": "now"
},
"title": "Myapp Overview",
"uid": "myapp-overview",
"version": 1
}
The custom dashboard becomes available in Grafana shortly after the ConfigMap is created.