Skip to main content
Skip table of contents

Grafana Dashboards

With Grafana, you can query and view collected metrics in easy-to-read graphs. Kommander ships with a set of default dashboards including:

  • Kubernetes Components: API Server, Nodes, Pods, Kubelet, Scheduler, StatefulSets and Persistent Volumes

  • Kubernetes USE method: Cluster and Nodes

  • Calico

  • etcd

  • Prometheus

Find the complete list of default enabled dashboards on GitHub.

To disable all of the default dashboards, follow these steps to define an overrides ConfigMap:

  1. Create a file named kube-prometheus-stack-overrides.yaml and paste the following YAML code into it to create the overrides ConfigMap:

    CODE
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: kube-prometheus-stack-overrides
      namespace: <your-workspace-namespace>
    data:
     values.yaml: |
       ---
       grafana:
         defaultDashboardsEnabled: false
  2. Use the following command to apply the YAML file:

    CODE
    kubectl apply -f kube-prometheus-stack-overrides.yaml
  3. Edit the kube-prometheus-stack AppDeployment to replace the spec.configOverrides.name value with kube-prometheus-stack-overrides. (You can use the steps in the procedure, Deploy an application with a custom configuration as a guide.) When your editing is complete, the AppDeployment will resemble this code sample:

    CODE
    apiVersion: apps.kommander.d2iq.io/v1alpha2
    kind: AppDeployment
    metadata:
      name: kube-prometheus-stack
      namespace: <your-workspace-namespace>
    spec:
      appRef:
        name: kube-prometheus-stack-34.9.3
        kind: ClusterApp
      configOverrides:
        name: kube-prometheus-stack-overrides

To access the Grafana UI, browse to the landing page and then search for the Grafana dashboard, for example, https://<CLUSTER_URL>/dkp/grafana.

Add Custom Dashboards

In Kommander you can define your own custom dashboards. You can use a few methods to import dashboards to Grafana.

One method is to use ConfigMaps to import dashboards. Below are steps on how to create a ConfigMap with your dashboard definition.

For simplicity, this section assumes the desired dashboard definition is in json format:

CODE
{
    "annotations": {
        "list": []
    },
    "description": "etcd sample Grafana dashboard with Prometheus",
    "editable": true,
    "gnetId": null,
    "hideControls": false,
    "id": 6,
    "links": [],
    "refresh": false,
    ...
}

After creating your custom dashboard json, insert it into a ConfigMap and save it as etcd-custom-dashboard.yaml:

CODE
apiVersion: v1
kind: ConfigMap
metadata:
  name: etcd-custom-dashboard
  labels:
    grafana_dashboard: "1"
data:
  etcd.json: |
    {
        "annotations": {
            "list": []
        },
        "description": "etcd sample Grafana dashboard with Prometheus",
        "editable": true,
        "gnetId": null,
        "hideControls": false,
        "id": 6,
        "links": [],
        "refresh": false,
        ...
    }

Apply the ConfigMap, which automatically gets imported to Grafana using the Grafana dashboard sidecar:

CODE
kubectl apply -f etcd-custom-dashboard.yaml
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.