Kubernetesクラスターの監視:Prometheusの概要と概要

Kubernetesの監視の概念を検討し、Prometheusツールに精通し、アラートについて説明しましょう。



監視トピックは膨大であり、1つの記事に分解することはできません。このテキストの目的は、ツール、概念、およびアプローチの概要を提供することです。



記事の内容は、スラムスクールの公開講演からの抜粋です完全なトレーニングを完了したい場合は、Kubernetesの監視およびロギングインフラストラクチャに関するコースにサインアップしてください。





Kubernetesクラスターで監視されるもの





物理サーバー。Kubernetesクラスターがサーバーにデプロイされている場合は、それらの状態を監視する必要があります。このタスクはZabbixによって処理されます。あなたが彼と一緒に働くならば、あなたは拒否する必要はありません、衝突はありません。サーバーの状態を監視するのはZabbixです。



クラスターレベルでの監視に移りましょう。



コントロールプレーンコンポーネント: API、スケジューラなど。少なくとも、サーバーまたはetcdのAPIが0より大きいことを監視する必要があります。Etcdは、スピンするディスク、etcdクラスターの状態など、多くのメトリックを提供できます。



Docker : . Docker, , , .



DNS. DNS, Discovery, . , , DNS . CoreDNS.



Ingress. ( Ingress Controller) .



— , .



, , , . : , ; 10, 2. . . , : -? , , — . .



, -: , .



Prometheus



Prometheus. , Prometheus . , « Kubernetes», Prometheus.



, Prometheus: Helm Prometheus Prometheus Operator.



  1. Prometheus. , ConfigMap — , , , .
  2. Prometheus Operator , , : , , .


, Prometheus. , : , . Prometheus Operator , .



Prometheus Kubernetes: API Server .



Prometheus , . , Prometheus , , . . , PostgreSQL Exporter: PostgreSQL Prometheus, Prometheus .



Prometheus





Prometheus Server — , Prometheus. .



time series database (TSDB). TSDB — , Go, Prometheus. , .



TSDB



Prometheus . 15 . , : TSDB , . Prometheus .



, , . TSDB « », . , , InfluxDB, ClickHouse . ClickHouse.

Prometheus Server pull: , . : « API Server», n- .



(job cron job), , Pushgateway. : job , , Pushgateway . Prometheus Pushgateway.



Prometheus — Alertmanager. — alerting rules. , alert , API 0. , alert alert manager . alert manager : - , , . Slack, Telegram, email .



- Prometheus — Discovering. Prometheus , . « IP-, — », , (targets — ). Prometheus , , , .



Kubernetes, : 10 , 3. IP- , , — Discovering .



Prometheus PromQL. , .



https://prometheus.io/docs/prometheus/latest/querying/basics/

 

    container_memory_usage_bytes

 

    container_memory_usage_bytes / 1024 / 1024

 

    sum(container_memory_usage_bytes) / 1024 / 1024

 

    100 - avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m]) * 100)


- Prometheus



Prometheus , -. .





Expression PromQL.



Alerts — alerting rules, :



  1. inactive — , , ;
  2. pending — , , . , : , ;
  3. firing — , .


Status , Prometheus. (targets), .





Prometheus Kubernetes.



Grafana



- Prometheus , . , Prometheus Grafana. .





Prometheus Grafana , : GRAFANA SUPPORT FOR PROMETHEUS, .



: Grafana Loki .



: , Kubernetes, Southbridge, .




All Articles