This guide outlines the steps to upgrade the Prometheus stack in a Kubernetes cluster.
- Helm 3 installed
- kubectl configured to your cluster
- Proper permissions to modify resources in the monitoring namespace
-
Update Helm repositories:
helm repo update
-
Upgrade the Prometheus stack:
helm upgrade relesease-name prometheus-community/kube-prometheus-stack \ --install \ -f "packages/relesease-name/values-dev.yaml" \ --namespace monitoring \ --create-namespace
Note: Replace
relesease-name
with your release name and adjust the values file path as needed. -
Scale down Grafana deployment to release the PVC:
kubectl scale deployment relesease-name-grafana -n monitoring --replicas=0
-
Scale up Grafana deployment:
kubectl scale deployment relesease-name-grafana -n monitoring --replicas=1
-
Verify the upgrade:
kubectl get pods -n monitoring
If you encounter a "Multi-Attach error for Volume" after scaling up Grafana, repeat steps 3 and 4.
- Ensure you have a backup of your Prometheus and Grafana data before upgrading.
- Review the changelog of the kube-prometheus-stack for any breaking changes before upgrading.
- Adjust resource requests and limits in your values file if needed after the upgrade.