Menu
- Products
- Solutions
- Resources
- About TEAM IM
- Contact
Grafana is essential for real-time monitoring of pod metrics in Kubernetes, allowing users to create dynamic dashboards for tracking and analyzing cluster performance with ease. Elevate monitoring with Grafana's intuitive interface and customization options.
First, Prometheus and Grafana must be installed in the Kubernetes cluster. You can see my previous article here for detailed steps on setting that up.
The next step is connecting to Grafana. There are 2 steps needed to achieve that:
kubectl port-forward svc/kube-prometheus-stack-grafana 3000:80 -n metrics
The username to log in is admin and the password can be found by running the following command and decoding the results in base64 (or a cursory Google search typically yields the default value):
kubectl get secret kube-prometheus-stack-grafana -o jsonpath="{.data.admin-password}" -n metrics
Once logged in to Grafana, select the Dashboards link in the sidebar. A list of pre-configured dashboards can be reviewed for samples of what can be done in Grafana. Click the New button then select New Dashboard to start with a fresh dashboard. From here, panels can be added, click Add visualization then select Prometheus as the data source to get started. As a sample of monitoring pod memory usage, configure as follows:
Pod memory should now be coming through in the panel. Additional panels can be added and configured by selecting Add -> Visualization. Panels can also be resized and moved by dragging the bottom right of the panel or dragging the top of the panel.
Additionally, it's possible to configure inputs for dynamically choosing which pod metrics to display. To do that:
Pod metrics for the entered pod should now come through in the graph! Numerous other metrics can also be displayed and it's even possible to set up multiple panels to display pod data side by side. Experiment around with the panels to see what's possible!
Finally, when not using persistent storage with the Prometheus Stack app, dashboards will not be saved when the pod is restarted. We recommend saving the dashboard configuration by:
Then if the pod is restarted or if importing into another environment:
It's also possible to use the metrics here for Horizontal Pod Auto-scaling, stay tuned to this space for more information on that!
These Stories on Azure
121 Washington Ave N, 4th Floor
Minneapolis, MN 55401
L2, 1 Post Office Square
Wellington 6011
119 Willoughby Road
Crows Nest NSW 2065
No Comments Yet
Let us know what you think