Manual deployment of Prometheus to monitor Kubernetes cluster combat

1. Deploy Prometheus on Kubernetes

The basic usage of Prometheus is mainly deployed in binary mode, but in the actual production environment, to monitor k8, Prometheus is more suitable for deployment in Kubernetes clusters. Here is how to use manual methods on Kubernetes clusters. Deploy Prometheus.

Here is to deploy Prometheus in the Kubernetes cluster, so a set of k8s cluster environment needs to be deployed in advance. The experimental environment I use here is based on Kubernetes v1.26.5 version, with a total of 3 nodes:

1. Create a Prometheus basic configuration file

For the convenience of management, I will install all resource objects related to monitoring under the namespace kube-pm. The creation command is as follows:

Next, first create a Prometheus basic configuration file prometheus.yml, and the configuration file is managed in the form of ConfigMap. The content of the prepared prometheus-cm.yml file is as follows:

Guess you like

Origin blog.csdn.net/qq_35029061/article/details/132465664