Prometheus and Alerts
Alert manager
The Alert Manager manages duplicating, grouping, and routing alerts to the correct receiver integration, such as email and PagerDuty and manages silencing and inhibition of alerts. Alertmanager must be installed on Cluster with service exposed on port and targetPort 9093.
If Alert manager is installed on the cluster, add a default receiver to Alertmanager configMap in the receiver section.
Prometheus
Prometheus is an open-source monitoring framework. It provides out-of-the-box monitoring capabilities for the Kubernetes container orchestration platform. It scrapes metrics from instrumented jobs and stores all scraped samples locally. It then manages this data and generates alerts.
Prometheus must be installed on a Cluster with service exposed on port and targetPort 9090. If Prometheus is installed on a cluster, Alertmanager requires data in a specific format to display relevant alert information about the UI. Hence, in the created config map to externalize Prometheus (config-map.yaml), the pod-level queries must include the namespace, pod name and description of the alert under the configuration of alerts.
In the previous example, the pod-level query is defined by expr, which creates an alert if the pod is using more CPU. The output of expr should contain the namespace and the pod name. To add these values in Alert manager, produce the output using $labels under labels section.
Along with Prometheus, node-exporter must also be installed for node-level metrics like memory usage, CPU usage, etc.
Prometheus cloud providers
Prometheus needs to be configured to each cloud service provider to pull data for its monitoring framework; visit each provider listed below for more details regarding configuration:
- AWS Configuration :Configure an AWS account to enable Container Cluster Management to discover and monitor resources and Kubernetes clusters hosted in Amazon Web Services.
- Azure Configuration: Configure an Azure account to enable Container Cluster Management to retrieve resource and cluster data from Azure Resource Manager.
- GCP Configuration: Configure a Google Cloud Platform account to allow Container Cluster Management to discover and collect information about cloud resources and Kubernetes clusters.
- IBM Cloud Configuration: Configure an IBM Cloud account to enable Container Cluster Management to access and collect data from IBM Cloud resources and managed clusters.
- Alibaba Cloud: Understand how to enable Alibaba Prometheus (ARMS), supporting your chosen monitoring and alert system.
- AWS Cloud: Understand how to activate AWS Prometheus Monitoring, supporting your chosen monitoring system.
- Azure Prometheus Monitoring: Understand how to Activate Azure Prometheus Monitoring, supporting your chosen monitoring system.
- GCP Cloud: Understand how to enable Prometheus on Google Cloud Platform, supporting your chosen monitoring system.
- IBM Cloud: How to enable IBM Cloud Prometheus, supporting your chosen monitoring system.