Monitoring metrics using Grafana dashboards

Grafana is an open source analytics and monitoring solution. By default, Grafana is used for querying Prometheus. Follow these instructions to expose the included Grafana service instance and access it through your web browser:

  1. Get the list of services in the monitoring namespace:
$ kubectl get svc -n monitoring
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
alertmanager-operated ClusterIP None <none> 9093/TCP,9094/TCP,9094/UDP 33m
prometheus-grafana ClusterIP 10.0.1.132 <none> 80/TCP 33m
prometheus-kube-state-metrics ClusterIP 10.0.69.144 <none> 8080/TCP 33m
prometheus-operated ClusterIP None <none> 9090/TCP 33m
prometheus-prometheus-node-exporter ClusterIP 10.0.100.183 <none> 9100/TCP 33m
prometheus-prometheus-oper-alertmanager ClusterIP 10.0.202.140 <none> 9093/TCP 33m
prometheus-prometheus-oper-operator ClusterIP 10.0.174.214 <none> 8080/TCP,443/TCP 33m
prometheus-prometheus-oper-prometheus ClusterIP 10.0.243.177 <none> 9090/TCP 33m
  1. Create a port forwarding to access the Grafana UI using the kubectl port-forward command. This command will forward the local port 8000 to port 3000 of a running Grafana pod:
$ kubectl port-forward -n monitoring prometheus-grafana 8000:80
As an alternative, you can patch the prometheus-grafana service using the kubectl edit svc prometheus-grafana -n monitoring command and change the service type, ClusterIP, to LoadBalancer to expose the service externally using a cloud load balancer.
  1. Go to http://localhost:8000 (or the External IP, if using LoadBalancer) in your web browser. You should see the Grafana login page:

  1. Log in using admin as the username and prom-operator as the password:

  1. Click on the Home button in the upper-left corner of the dashboard to list the available built-in dashboards:

  1. As an example, select the Nodes dashboard from the list to show Kubernetes nodes metrics. In this view, you will see the graphical representation of node resources, including CPU, memory, disk, and network utilization:

Now you know how to navigate through dashboards in Grafana. You can use Grafana to visualize Kubernetes metrics and other workload metrics that provide metrics for Prometheus by following the next recipe.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.189.199