Update Grafana Kubernetes components
The engineering team regularly pushes updates to Grafana Cloud Kubernetes Monitoring and the Grafana Agent. You must update these components manually to take advantage of any updates to Grafana dashboards, alerting & recording rules, and new Grafana Agent features.
Update dashboards, alerting rules, and recording rules
To get the latest versions of dashboards, alerting rules, and recording rules, you must uninstall and reinstall Grafana Agent.
Warning: Uninstalling Agent deletes its associated dashboard folder, and its alert and recording rule namespace. Custom dashboards or alerts added to the default locations for this integration are also removed. Be sure to save a copy of these if you’ve modified the provisioned versions.
- Navigate to your Grafana Cloud instance and click the Kubernetes Monitoring icon (ship wheel).
- Click the Configuration tab.
- Click Uninstall dashboards and rules.
- Click Install dashboards and rules to reinstall.
From here, you can reinstall Agent. This will install the latest version of the Kubernetes Monitoring components into your Grafana instance.
Update Grafana Agent
After performing the uninstall/reinstall step for dashboards and rules, you need to also update Grafana Agent. The Agent instructions in the Kubernetes Monitoring Configuration tab contain the latest version of the preconfigured Agent manifests.
If the Kubernetes objects have the same name and are in the same namespace, the
kubectl apply -f command updates the objects to the latest version.
To replace your Grafana Agent deployment with a StatefulSet (recommended, and now the default), follow the instructions on the Kubernetes Monitoring Configuration tab. Following the steps updates your existing Agent ConfigMap (or creates it if it doesn’t exist), and creates an Agent StatefulSet.
Once that’s up and running, you can delete the existing Deployment by running the following command:
kubectl delete deployment/grafana-agent
At this point you’ll have an Agent StatefulSet scraping Prometheus metrics in your cluster and shipping these to Grafana Cloud. This StatefulSet is also configured by default to collect Kubernetes events and ship these to Grafana Cloud Loki. You can disable this by modifying the StatefulSet’s ConfigMap.
The Kubernetes Monitoring configuration instructions include a step to deploy kube-state-metrics using Helm.
To upgrade the kube-state-metrics chart to the latest version, use the following command:
helm upgrade ksm prometheus-community/kube-state-metrics --set image.tag=v2.4.2 -n default
Related Grafana Cloud resources
How to set up and visualize synthetic monitoring at scale with Grafana Cloud
Learn how to use Kubernetes, Grafana Loki, and Grafana Cloud’s synthetic monitoring feature to set up your infrastructure's checks in this GrafanaCONline session.
Using Grafana Cloud to drive manufacturing plant efficiency
This GrafanaCONline session tells how Grafana helps a 75-year-old manufacturing company with product quality and equipment maintenance.