Installing Prometheus
Prometheus is an open-source software used for event monitoring and alarm reporting.
MCP can use Prometheus to report monitoring data of Kubernetes clusters to the monitoring center. To use this function, install Prometheus in the Kubernetes clusters.
Prerequisites
Helm has been installed.
Procedure
Use the Prometheus chart in the Kubernetes chart repository to install Prometheus.
- Create a value.yaml file and set installation parameters.
vi value.yaml
The following is an example:
pushgateway: enabled: false # Do not install pushgateway. alertmanager: persistentVolume: existingClaim: pvc-name server: # Configuration of the Prometheus server persistentVolume: # Local persistent storage existingClaim: pvc-name global: external_labels:Configuration description:
- For details about the Prometheus chart, see https://github.com/helm/charts/tree/master/stable/prometheus.
- The chart contains the alertmanager, kube-state-metrics, node-exporter.yaml, pushgateway, and prometheus server components. You can determine whether to deploy the components by setting corresponding parameters. By default, all components are deployed. Generally, the pushgateway component does not need to be deployed. You can set pushgateway.enabled to false to skip the deployment.
- By default, the alertermanager component is deployed through a Deployment and persistent storage is used to store local data. You can use alertmanager.persistentVolume.existingClaim to transfer an existing PVC name. You can also set the storage-class parameter in annotation to automatically create a new PVC. If persistent storage is not required, you can set alertmanager.persistentVolume.enabled to false and use empty-dir to store data.
- By default, the prometheus server component is deployed through a Deployment and persistent storage is used to store local data. By default, data is stored for 15 days. You can use server.persistentVolume.existingClaim to transfer an existing PVC name. You can also set the storage-class parameter in annotation to automatically create a new PVC. If persistent storage is not required, you can set server.persistentVolume.enabled to false and use empty-dir to store data.
- Install Prometheus. If Helm2 is used, run the following command to install Prometheus:
helm install stable/prometheus --namespace monitoring --values value.yaml --name prometheus
If Helm3 is used, run the following command to install Prometheus:helm install prometheus stable/prometheus --namespace monitoring --values value.yaml
Last Article: Installing the Metrics Server
Next Article: Installing Prometheus Adapter
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.