Overview of grafana-dashboards-kubernetes
masterkube-prometheus-stack Helm chart, but are compatible with any setup that includes kube-state-metrics and prometheus-node-exporter.repository·master·Indexed 25 days ago
https://github.com/dotdc/grafana-dashboards-kubernetesA collection of modern Grafana dashboards for Kubernetes monitoring, optimized for the kube-prometheus-stack. Requires kube-state-metrics and prometheus-node-exporter. Includes specialized dashboards for the API Server, CoreDNS, Prometheus, Trivy Operator, and global, namespace, node, and pod views. Supports installation via ArgoCD, Helm, Kubernetes ConfigMaps, Terraform, and the Grafana Operator.
kube-prometheus-stack Helm chart, but are compatible with any setup that includes kube-state-metrics and prometheus-node-exporter.Current versions of these dashboards do not support Windows. If you require Windows support, you must use an older version of the k8s-views-global dashboard.
You can download the last Windows-compatible version (v2.10.1) or a specific revision from Grafana.com.
Dashboards can be provisioned as ConfigMaps using Kustomize. This requires the Grafana dashboards sidecar to be enabled.
To preview the generated ConfigMaps on STDOUT:
kubectl kustomize .To deploy them directly to a specific namespace (e.g., monitoring):
kubectl apply -k . -n monitoringNote: The default namespace is defined in kustomization.yaml.
kubectl kustomize .
# OR
kubectl apply -k . -n monitoringTo use these dashboards effectively, your Kubernetes cluster must have the following components installed:
While designed for the kube-prometheus-stack, they work with other Prometheus setups as long as the above metrics are available. Note that these dashboards utilize features from newer Grafana versions, including gradient mode (Grafana 8.1+), time series panels (Grafana 7.4+), and the $__rate_interval variable (Grafana 7.2+).
To install dashboards manually:
+ sign in the left menu and click Import.Upload JSON file button and select the JSON files from your local clone of the repository.Import via grafana.com field and click Load.To deploy dashboards using ArgoCD, apply the provided argocd-app.yml manifest. Note that you must have the Grafana dashboards sidecar enabled and configured as described in the setup guide.
kubectl apply -f argocd-app.ymlIf using the Grafana Operator, you can provision dashboards using the GrafanaDashboard custom resource. You must specify the url pointing to the raw JSON file in the repository and ensure the instanceSelector matches your Grafana instance labels.
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: k8s-system-api-server
namespace: monitoring
spec:
instanceSelector:
matchLabels:
dashboards: "grafana"
url: "https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-api-server.json"To use these dashboards with Terraform, use tfk8s to convert the generated ConfigMaps into Terraform code.
kubectl kustomize . | tfk8sEnsure the Grafana dashboards sidecar is enabled. You must also have the dashboards sidecar configured to watch the namespace where these ConfigMaps are deployed.
When deploying dashboards via ArgoCD, ConfigMaps, Terraform, or Helm, you must enable and configure the dashboards sidecar in your Grafana Helm chart (e.g., kube-prometheus-stack). This allows Grafana to automatically load dashboards from Kubernetes resources.
Key configuration settings include:
enabled: Set to true.defaultFolderName: The default folder for dashboards (e.g., "General").label: The label used to identify dashboards (default: grafana_dashboard).labelValue: The value of the label (default: 1).folderAnnotation: Annotation used for folder organization (default: grafana_folder).searchNamespace: The namespace to search for dashboards (e.g., ALL).provider.foldersFromFilesStructure: Set to true to use file structure for folders.# kube-prometheus-stack values
grafana:
sidecar:
dashboards:
enabled: true
defaultFolderName: "General"
label: grafana_dashboard
labelValue: "1"
folderAnnotation: grafana_folder
searchNamespace: ALL
provider:
foldersFromFilesStructure: trueYou can install dashboards directly using dashboardProviders and dashboards values in your Helm chart.
For kube-prometheus-stack: Use the grafana: prefix.
For official Grafana helm chart: Remove the grafana: prefix and reduce the indentation level of the entire block.
grafana:
# Provision grafana-dashboards-kubernetes
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: 'grafana-dashboards-kubernetes'
orgId: 1
folder: 'Kubernetes'
type: file
disableDeletion: true
editable: true
options:
path: /var/lib/grafana/dashboards/grafana-dashboards-kubernetes
dashboards:
grafana-dashboards-kubernetes:
k8s-system-api-server:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-api-server.json
token: ''
k8s-system-coredns:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-coredns.json
token: ''
k8s-views-global:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-global.json
token: ''
k8s-views-namespaces:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-namespaces.json
token: ''
k8s-views-nodes:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-nodes.json
token: ''
k8s-views-pods:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-pods.json
token: ''The k8s-views-nodes dashboard may show broken panels if the node label from kube_node_info does not match the nodename label from node_uname_info. This often occurs when the node exporter is deployed via a DaemonSet.
You can fix this by relabeling the metric to force the nodename label to match the Kubernetes node name using one of the following methods depending on your deployment type.
If panels appear broken when using Grafana Agent or Grafana Mimir, it may be due to the $resolution variable being set too low. You can resolve this by:
$resolution variable to a higher value (which results in a lower resolution).Scrape interval in your Grafana Datasource to a value compatible with your setup.