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:
Create a file named
kube-prometheus-stack-overrides.yaml
and paste the following YAML code into it to create the overrides ConfigMap:CODEapiVersion: v1 kind: ConfigMap metadata: name: kube-prometheus-stack-overrides namespace: <your-workspace-namespace> data: values.yaml: | --- grafana: defaultDashboardsEnabled: false
Use the following command to apply the YAML file:
CODEkubectl apply -f kube-prometheus-stack-overrides.yaml
Edit the
kube-prometheus-stack
AppDeployment to replace thespec.configOverrides.name
value withkube-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:CODEapiVersion: apps.kommander.d2iq.io/v1alpha2 kind: AppDeployment metadata: name: kube-prometheus-stack namespace: <your-workspace-namespace> spec: appRef: name: kube-prometheus-stack-44.2.1 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:
{
"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
:
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:
kubectl apply -f etcd-custom-dashboard.yaml