Installing Prometheus and Grafana
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
kubectl create namespace monitoring
helm install prometheus prometheus-community/prometheus \
--namespace monitoring \
--set alertmanager.persistentVolume.storageClass="standard" \
--set server.persistentVolume.storageClass="standard"
mkdir ${HOME}/environment/grafana
cat << EoF > ${HOME}/environment/grafana/grafana.yaml
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-server.monitoring.svc.cluster.local
access: proxy
isDefault: true
EoF
helm install grafana grafana/grafana \
--namespace monitoring \
--set persistence.storageClassName="standard" \
--set persistence.enabled=true \
--set adminPassword='subje' \
--values ${HOME}/Documents/monitoring/grafana.yaml \
--set service.type=LoadBalancer
For example template ID: 6417 https://grafana.com/grafana/dashboards/6417
I was installing Prometheus and Grafana on a GKE cluster and faced a problem while following these steps.
At all the places where we have --set persistence.storageClassName="default", it should be --set persistence.storageClassName="standard". Because there are no default storage classes in GKE but there are standard ones.