Setting up grafana, prometheus and alertmanager on kubernetes using helm
This project depends on kube-prometheus-stack
- Kubernetes 1.16+
- Helm 3+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
See helm repo for command documentation.
# Helm
helm install --namespace monitoring demo -f alertmanager/values.yaml -f grafana/values.yaml -f prometheus/values.yaml prometheus-community/kube-prometheus-stack
#Rules Alertmanager kubectl edit prometheusrules demo-kube-prometheus-st-alertmanager.rules -n monitoring copy rules from prometheus/rules.yaml kubectl apply -f alertmanager-secret-k8s.yaml See configuration below.
See helm install for command documentation.
By default this chart installs additional, dependent charts:
- prometheus-community/kube-state-metrics
- prometheus-community/prometheus-node-exporter
- grafana/grafana
To disable dependencies during installation, see multiple releases below.
See helm dependency for command documentation.
# Helm
helm upgrade --namespace monitoring demo -f alertmanager/values.yaml -f grafana/values.yaml -f prometheus/values.yaml prometheus-community/kube-prometheus-stack
kubectl apply -f secrets/alert-config.yaml
kubectl apply -f rna-kube-prometheus-stack/prometheus/rules.yaml
# Helm
helm uninstall demo -n monitoring
This removes all the Kubernetes components associated with the chart and deletes the release.
See helm uninstall for command documentation.
CRDs created by this chart are not removed by default and should be manually cleaned up:
kubectl delete crd alertmanagerconfigs.monitoring.coreos.com -n monitoring
kubectl delete crd alertmanagers.monitoring.coreos.com -n monitoring
kubectl delete crd podmonitors.monitoring.coreos.com -n monitoring
kubectl delete crd probes.monitoring.coreos.com -n monitoring
kubectl delete crd prometheuses.monitoring.coreos.com -n monitoring
kubectl delete crd prometheusrules.monitoring.coreos.com -n monitoring
kubectl delete crd servicemonitors.monitoring.coreos.com -n monitoring
kubectl delete crd thanosrulers.monitoring.coreos.com -n monitoring