Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

kube-prometheus-stack

Updated on 2025-01-24 GMT+08:00

Introduction

kube-prometheus-stack provides easy-to-use, end-to-end Kubernetes cluster monitoring capabilities by using Prometheus Operators and Prometheus. It also supports customized add-on specifications, interconnection with Grafana, high availability, and node affinity.

The core components of kube-prometheus-stack include prometheusOperator, prometheus, alertmanager, thanosSidecar, thanosQuery, adapter, kubeStateMetrics, nodeExporter, and grafana.

  • prometheusOperator: deploys and manages the Prometheus Server based on Custom Resource Definition (CRDs), and monitors and processes the events related to these CRDs. It is the control center of the entire system.
  • prometheus (Server): a Prometheus Server cluster deployed by the operator based on the Prometheus CRDs that can be regarded as StatefulSets.
  • alertmanager: the alarm center of the add-on. It receives alarms sent by Prometheus and manages alarm information by deduplicating, grouping, and distributing.
  • thanosSidecar: in HA scenarios, runs with Prometheus in the same pod to implement persistent storage of Prometheus metric data.
  • thanosQuery: entry for PromQL query when Prometheus is in HA scenarios. It can delete duplicate data of the same metrics from Store or Prometheus.
  • adapter (custom-metrics-apiserver): aggregates custom metrics to the native Kubernetes API Server.
  • kube-state-metrics: converts the Prometheus metric data into a format that can be identified by Kubernetes APIs. By default, kube-state-metrics does not collect all labels and annotations of Kubernetes resources. If these labels and annotations need to be collected, see How Do I Modify the Collection Configuration of the kube-state-metrics Component?
  • nodeExporter: deployed on each node to collect node monitoring data.
  • grafana: visualizes monitoring data. grafana creates a 5 GiB storage volume by default. Uninstalling the add-on will not delete this volume.
  • clusterProblemDetector: monitors cluster exceptions.

Constraints

kube-prometheus-stack cannot be installed in UCS on-premises clusters.

Add-on Deployment Modes

The kube-prometheus-stack add-on can be deployed in Agent or Server mode.

  • The add-on deployed in Agent mode occupies fewer cluster resources and provides Prometheus metric collection for clusters. However, it does not support the HPA and health diagnosis functions based on custom Prometheus statements.
  • The add-on deployed in Server mode supports the HPA and health diagnosis functions based on custom Prometheus statements. This mode depends on the PVC and consumes a large amount of memory.

Precaution

kube-prometheus-stack is a system monitoring add-on. When cluster resources are insufficient, Kubernetes prioritizes resource scheduling to the pod where the add-on runs.

Permissions

nodeExporter monitors the disk space of Docker and reads the info data of Docker from the /var/run/dockersock directory of the host.

The following privilege is required by nodeExporter:

  • cap_dac_override: reads the info data of Docker.

Upgrading the Add-on

  1. Select a fleet or a cluster that is not added to the fleet.

    Figure 1 Selecting a fleet or a cluster not in the fleet

  2. Choose Container Insights > Clusters to view the clusters with monitoring enabled. Locate the cluster for which the add-on is to be upgraded and click View Details in the Operation column to access its overview page.
  3. The version of kube-prometheus-stack is displayed in the upper right corner. If the version is not the latest, upgrade the add-on to experience the latest functions.

Resource Quota Requirements of Different Specifications

Before installing the kube-prometheus-stack add-on, ensure that the cluster has sufficient schedulable resources such as CPUs and memory. For details about the resource quota requirements of default specifications in Agent mode, see Table 1. For details about the resource quota requirements of different add-on specifications in Server mode, see Table 2.

Table 1 Resource quota requirements of default specifications in Agent mode

Add-on Specification

Container

CPU Quota

Memory Quota

Default

prometheusOperator

Request: 100m

Limit: 500m

Request: 100 MiB

Limit: 500 MiB

prometheus

Request: 500m

Limit: 4

Request: 1 GiB

Limit: 8 GiB

kube-state-metrics

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 500 MiB

nodeExporter

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 1 GiB

grafana

Request: 100m

Limit: 500m

Request: 200 MiB

Limit: 2 GiB

Table 2 Resource quota requirements of different specifications in Server mode

Add-on Specification

Container

CPU Quota

Memory Quota

Demo (≤ 100 containers)

prometheusOperator

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 500 MiB

prometheus

Request: 500m

Limit: 2

Request: 2 GiB

Limit: 8 GiB

alertmanager

Request: 200m

Limit: 1

Request: 200 MiB

Limit: 1 GiB

thanosSidecar

Request: 100m

Limit: 1

Request: 100 MiB

Limit: 2 GiB

thanosQuery

Request: 500m

Limit: 2

Request: 500 MiB

Limit: 4 GiB

adapter

Request: 400m

Limit: 2

Request: 400 MiB

Limit: 1 GiB

kube-state-metrics

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 500 MiB

nodeExporter

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 1 GiB

grafana

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 2 GiB

clusterProblemDetector

Request: 100m

Limit: 200m

Request: 200 MiB

Limit: 400 MiB

Small (≤ 2,000 containers)

prometheusOperator

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 500 MiB

prometheus

Request: 4

Limit: 8

Request: 16 GiB

Limit: 32 GiB

alertmanager

Request: 500m

Limit: 1

Request: 500 MiB

Limit: 1 GiB

thanosSidecar

Request: 500m

Limit: 1

Request: 500 MiB

Limit: 2 GiB

thanosQuery

Request: 2

Limit: 4

Request: 2 GiB

Limit: 16 GiB

adapter

Request: 2

Limit: 4

Request: 4 GiB

Limit: 16 GiB

kube-state-metrics

Request: 500m

Limit: 1

Request: 500 MiB

Limit: 1 GiB

nodeExporter

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 1 GiB

grafana

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 2 GiB

clusterProblemDetector

Request: 200m

Limit: 500m

Request: 300 MiB

Limit: 1 GiB

Medium (≤ 5,000 containers)

prometheusOperator

Request: 500m

Limit: 1

Request: 500 MiB

Limit: 1 GiB

prometheus

Request: 8

Limit: 16

Request: 32 GiB

Limit: 64 GiB

alertmanager

Request: 500m

Limit: 1

Request: 500 MiB

Limit: 2 GiB

thanosSidecar

Request: 1

Limit: 2

Request: 1 GiB

Limit: 4 GiB

thanosQuery

Request: 2

Limit: 4

Request: 2 GiB

Limit: 16 GiB

adapter

Request: 2

Limit: 4

Request: 16 GiB

Limit: 32 GiB

kube-state-metrics

Request: 1

Limit: 2

Request: 1 GiB

Limit: 2 GiB

nodeExporter

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 1 GiB

grafana

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 2 GiB

clusterProblemDetector

Request: 200m

Limit: 1

Request: 400 MiB

Limit: 2 GiB

Large (> 5,000 containers)

prometheusOperator

Request: 500m

Limit: 1

Request: 500 MiB

Limit: 2 GiB

prometheus

Request: 8

Limit: 32

Request: 64 GiB

Limit: 128 GiB

alertmanager

Request: 1

Limit: 2

Request: 1 GiB

Limit: 4 GiB

thanosSidecar

Request: 2

Limit: 4

Request: 2 GiB

Limit: 8 GiB

thanosQuery

Request: 2

Limit: 4

Request: 2 GiB

Limit: 32 GiB

adapter

Request: 2

Limit: 4

Request: 32 GiB

Limit: 64 GiB

kube-state-metrics

Request: 1

Limit: 3

Request: 1 GiB

Limit: 3 GiB

nodeExporter

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 1 GiB

grafana

Request: 200m

Limit: 500m

Request: 200 MiB

Limit: 2 GiB

clusterProblemDetector

Request: 200m

Limit: 1

Request: 400 MiB

Limit: 2 GiB

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback