Grafana Kubernetes MonitoringConfigure Kubernetes MonitoringUpdating Grafana Kubernetes components

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 will delete its associated dashboard folder and alert and recording rule namespace. Any custom dashboards or alerts added to the default locations for this integration will also be removed. Be sure to save a copy of these if you’ve modified the provisioned versions.

  1. Click Integrations and Connections (lightning bolt in the left-hand navigation bar).
  2. Click on the Kubernetes Monitoring icon.
  3. Click Uninstall dashboards and rules.

From here, you can reinstall Agent. This will install the latest version of the Kubernetes Monitoring components into your Grafana instance.

Updating Grafana Agent

Kubernetes Monitoring also provides pre-configured Grafana Agent manifests to get you up and running quickly with Grafana Cloud.

After performing the uninstall/reinstall step described above, you’ll see the latest version of the pre-configured Agent manifests in the setup instructions.

If the Kubernetes objects have the same name and are in the same namespace, the kubectl apply -f command will update the object to the latest version.

To replace your Grafana Agent deployment with a StatefulSet (recommended, and now the default), you can follow the instructions in the latest version of the Kubernetes setup instructions, which will update your existing Agent ConfigMap (or create it if it doesn’t exist), and create 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.

Updating kube-state-metrics

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