Use a third-party chart
Helm is the package manager for Kubernetes. A chart bundles an application’s manifests so you install it with one command and configure it through values. This installs Grafana from its official chart.
It assumes:
- You can reach your cluster with
kubectl(see the kubectl quickstart). - You have Helm installed locally.
Add the repository
Section titled “Add the repository”helm repo add grafana https://grafana.github.io/helm-chartshelm repo updateConfigure values
Section titled “Configure values”A chart’s values.yaml is how you override its defaults. Create a namespace and
a values file:
kubectl create namespace monitoringcat <<'EOF' > values.yamladminPassword: change-mepersistence: enabled: trueEOFpersistence provisions a PVC from the cluster’s default StorageClass, so
dashboards survive pod restarts.
Install
Section titled “Install”helm install grafana grafana/grafana -n monitoring -f values.yamlVerify
Section titled “Verify”kubectl rollout status -n monitoring deploy/grafanakubectl port-forward -n monitoring svc/grafana 3000:80Open http://localhost:3000 and log in as admin with the password you set.
Upgrade
Section titled “Upgrade”Edit values.yaml, then re-apply. Helm diffs the release and bumps its
revision:
helm upgrade grafana grafana/grafana -n monitoring -f values.yamlhelm list -n monitoringClean up
Section titled “Clean up”helm uninstall grafana -n monitoringkubectl delete namespace monitoring