Automatic deployment of Prometheus to monitor Kubernetes cluster combat

1. Indicators that Kubernetes needs to monitor

Prometheus generally considers the following aspects for the monitoring of Kubemetes clusters:

  • Kubermetes node monitoring, such as node CPU, Load, fdisk, Memory and other indicators. These indicators can be implemented using node_exporter, that is, each node deploys node_exporter.
  • The status of internal system components, such as the running status of kube-scheduler, kube-controller-nanager, kubedns/coredns and other components. Orchestration-level metrics, such as data indicators such as Deployment status, resource requests, scheduling, and API delays. It can be achieved through Kube-state-metrics.

kube-state-metrics simply provides a metrics data and does not store these metrics data. We can use Prometheus to grab these data and store them.

The indicators that kube-state-metrics can obtain are as follows:

  • Deployment, Pod, replica status, etc.;
  • How many replicas are scheduled;
  • There are several pods available now;
  • How many Pods are running/stopped/terminated;
  • How many times the Pod has been restarted;
  • How many jobs I have running;

2. Several methods of Prometheus monitoring Kubernetes

1. Manual deployment

The basic process is to deploy Prometheus on Kubernetes by writing YAML files, that is, Prometheus, kube-state-metrics, node-exporter, and Grafana are deployed in sequence.

The general steps are as follows:

  • Replace the mirror (if needed);
  • Adjust the yaml file;

Guess you like

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