KubernetesKubernetes IntegrationUpdating the Kubernetes Integration

Updating the Kubernetes Integration

The engineering team regularly pushes updates to Grafana Cloud’s Kubernetes integration 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.

Updating dashboards, alerting rules, and recording rules

To fetch the latest version of the integration’s dashboards, alerting rules, and recording rules, you must uninstall and reinstall the Kubernetes integration.

Warning: Uninstalling an integration 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.

  • Click Integrations and Connections (lightning bolt in the left-hand navigation bar).
  • Click on the Kubernetes integration.
  • Click Uninstall integration.

From here, you can reinstall the integration. This will install the latest version of the Kubernetes integration into your hosted Grafana instance.

Updating Grafana Agent

The Kubernetes integration also provides preconfigured 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 preconfigured Agent manifests in the integration setup instructions.

If the Kubernetes objects have the same name and are in the same namespace, a kubectl apply -f should do the trick to 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 K8s 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 integration setup 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