DevOpsProdigy KubeGraf is an excellent Grafana Kubernetes plugin, an update to Grafana’s official Kubernetes Plugin. The plugin can be used to visualize and analyze the performance of a Kubernetes cluster, visually displaying the metrics and characteristics of the main services of the Kubernetes cluster through various graphs, and can also be used to examine the application lifecycle and error logs.

Environment Requirements

To install and use the DevOpsProdigy KubeGraf plugin you need to meet the following requirements.

  • Grafana > version 5.0.0
  • Need to deploy Prometheus + node-exporter + kube-state-metrics on a Kubernetes cluster
  • Reliance on the Grafana-piechart-panel plugin

Features

The plugin contains 3 main information pages with detailed information about Kubernetes clusters.

Application Overview

This plugin displays some basic monitoring information for the applications on top of a Kubernetes cluster.

  • Application logic diagram
  • Distribution of Kubernetes objects
  • Visualization of the application lifecycle and basic feature information
  • descriptive information about the service ports that are allowed to be accessed in the cluster

Cluster Status

  • Cluster and cluster node status information
  • Detailed information on the lifecycle of the monitored applications
  • Visualization of the location of services in the cluster

Node Overview

  • Cluster node information
  • Information on used and allocated resources (memory, CPU utilization) and number of containers
  • Physical distribution of Pods

Dashboards

In addition to the usual information provided on the plugin’s homepage, the plugin provides five additional Dashboards for us to track various performance metrics of the cluster.

  • node dashboard

This is a Dashboard with node metrics that shows resource usage, such as CPU utilization, memory consumption, percentage of CPU time in idle/iowait mode, and disk and network status.

  • pod dashboard

You can display the corresponding resource usage according to the selected Pod.

  • deployments dashboard

The Deployment dimension displays the resource usage associated with the corresponding resource object.

  • statefulsets dashboard
  • daemonsets dashboard

The above three Dashboards show the number of copies of available/unavailable applications and the container status of those applications, and also track container restarts.

Installation

We have Grafana here also installed on top of a Kubernetes cluster, so we need to go into the container to install it:.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
$ kubectl get pods -n kube-mon
NAME                         READY   STATUS    RESTARTS   AGE
grafana-5579769f64-7729f     1/1     Running   0          104s
......
$ kubectl exec -it grafana-5579769f64-7729f -n kube-mon /bin/bash
bash-5.0# grafana-cli plugins install devopsprodigy-kubegraf-app

installing devopsprodigy-kubegraf-app @ 1.3.0
from: https://grafana.com/api/plugins/devopsprodigy-kubegraf-app/versions/1.3.0/download
into: /var/lib/grafana/plugins

✔ Installed devopsprodigy-kubegraf-app successfully 

Restart grafana after installing plugins . <service grafana-server restart>

bash-5.0# # 如果没有安装 Grafana-piechart-panel 插件同样需要安装
bash-5.0# grafana-cli plugins install Grafana-piechart-panel
......

After the plugin is installed, you need to restart Grafana before it takes effect. We are a Pod here, so you can just delete the Pod rebuild (provided of course that the plugin directory is well persisted):

1
2
$ kubectl delete pod grafana-5579769f64-7729f -n kube-mon
pod "grafana-5579769f64-7729f" deleted

Once the Pod removal rebuild is complete, the plugin is installed successfully. Then open Grafana in your browser and find the plugin and click enable to enable the plugin.

Click Set up your first k8s-cluster to create a new Kubernetes cluster:

  • Just use the Kubernetes Service address for the URL: https://kubernetes.default:443
  • Access access mode is used: Server(default)
  • Since the plugin accesses various resource objects information of the Kubernetes cluster, we need to configure the access rights, here we can simply use kubectl’s kubeconfig to configure it.
  • Check the TLS Client Auth and With CA Cert options under Auth
  • The value under TLS Auth Details corresponds to the certificate information in kubeconfig. For example, our kubeconfig file here is in the following format.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <certificate-authority-data>
    server: https://ydzs-master:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: kubernetes-admin
  name: kubernetes-admin@kubernetes
current-context: 'kubernetes-admin@kubernetes'
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: <client-certificate-data>
    client-key-data: <client-key-data>

Then the value of CA Cert corresponds to the base64 decoded value of <certificate-authority-data> in kubeconfig; the value of Client Cert corresponds to the base64 decoded value of <client-certificate-data>; the value of Client Key corresponds to the base64 decoded value of <client-key-data>; and the value of Client Key corresponds to the base64 decoded value of The value of Client Key corresponds to the value of <client-key-data> after base64 decoding.

For base64 decoding, we recommend using some online services such as https://www.base64decode.org/ , which is very convenient.

  • Finally, select the prometheus datasource from the additional datasources drop-down list.
  • Click Save & Test to save it successfully.

Once the plugin is configured, the DevOpsProdigy KubeGraf plugin portal will appear in the left sidebar, and you can view the status of the entire cluster and the related Dashboard monitoring charts through the plugin page.