Alerts and monitoring
Prometheus and Grafana, the popular tools in the Kubernetes world, can be used for Crossplane monitoring as well. Before starting, we should ensure that the Crossplane pod can emit metrics. It is as simple as setting the metrics parameter to true
(--set metrics.enabled=true
) during the Helm deployment of Crossplane. We can do it either at the first Crossplane release or upgrade the Helm release using the following command:
# Fresh install with metrics enables
helm install crossplane --namespace crossplane-system crossplane-stable/crossplane --set args='{--debug}' --set metrics.enabled=true
# Helm upgrade with metrics enables
helm upgrade crossplane --namespace crossplane-system crossplane-stable/crossplane --set args='{--debug}' --set metrics.enabled=true
We can split the monitoring and alert setup into three parts:
- Enable Prometheus to scrape metrics.
- Set up monitoring alerts.
- Enable the Grafana dashboard. ...