Scripts2026年5月23日·1 分钟阅读

kube-prometheus — Production-Ready Kubernetes Monitoring Stack

kube-prometheus provides a complete Kubernetes monitoring stack combining Prometheus, Grafana, Alertmanager, and node-exporter with opinionated defaults and pre-built dashboards.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
kube-prometheus Overview
通用 CLI 安装命令
npx tokrepo install 5359f1b2-56a2-11f1-9bc6-00163e2b0d79

Introduction

kube-prometheus is an opinionated collection of Kubernetes manifests, Grafana dashboards, and Prometheus recording and alerting rules that deploys a complete monitoring stack for Kubernetes clusters. Maintained by the Prometheus Operator team, it bundles Prometheus, Alertmanager, Grafana, node-exporter, kube-state-metrics, and blackbox-exporter with sensible defaults for immediate production use.

What kube-prometheus Does

  • Deploys a complete Prometheus-based monitoring stack with a single kubectl apply
  • Includes 100+ pre-configured alerting rules for Kubernetes components and node health
  • Ships with curated Grafana dashboards for cluster, node, pod, and workload monitoring
  • Manages Prometheus and Alertmanager lifecycle via the Prometheus Operator CRDs
  • Collects metrics from kubelets, kube-state-metrics, node-exporter, and CoreDNS automatically

Architecture Overview

kube-prometheus generates its manifests using jsonnet and the kube-prometheus jsonnet library. The Prometheus Operator watches for ServiceMonitor and PrometheusRule custom resources to configure Prometheus scrape targets and alerting rules declaratively. Two Prometheus replicas run for high availability, Alertmanager handles deduplication and routing of alerts, and Grafana visualizes metrics with pre-loaded dashboards. All components deploy in the monitoring namespace with RBAC policies and network policies pre-configured.

Self-Hosting & Configuration

  • Requires a Kubernetes cluster (1.25+) with kubectl configured
  • Apply manifests/setup first to install CRDs, then manifests/ for the full stack
  • Customize the stack by forking the jsonnet source and regenerating manifests with jsonnet-bundler
  • Add application monitoring by creating ServiceMonitor resources pointing to your service endpoints
  • Configure Alertmanager routing for Slack, PagerDuty, or email via the alertmanager-secret

Key Features

  • Batteries-included deployment with Prometheus, Grafana, Alertmanager, and exporters
  • Pre-built alerting rules following Kubernetes monitoring best practices and SLO methodology
  • Grafana dashboards for USE method analysis of nodes and RED method analysis of services
  • Jsonnet-based customization for reproducible, version-controlled monitoring configuration
  • Network policies and RBAC included for secure multi-tenant monitoring

Comparison with Similar Tools

  • Prometheus Operator alone — provides CRDs and lifecycle management; kube-prometheus adds dashboards, alerts, and a full stack
  • Helm kube-prometheus-stack — Helm chart wrapping similar components; kube-prometheus uses jsonnet for more composable customization
  • Datadog / New Relic — commercial SaaS monitoring; kube-prometheus is self-hosted and free
  • VictoriaMetrics stack — alternative metrics backend; kube-prometheus is Prometheus-native with broader community adoption
  • Grafana Cloud — managed Prometheus and Grafana; kube-prometheus runs entirely within your cluster

FAQ

Q: How does kube-prometheus differ from the kube-prometheus-stack Helm chart? A: Both deploy similar components. kube-prometheus uses jsonnet for manifest generation and is the upstream reference. The Helm chart (maintained by the community) wraps similar resources with Helm values for easier customization.

Q: Can I add custom dashboards and alerting rules? A: Yes. Add ConfigMaps for Grafana dashboards and PrometheusRule resources for custom alerts. With the jsonnet approach, you can compose custom rules into the generated manifests.

Q: How much resource does the monitoring stack consume? A: Resource usage depends on cluster size and metric cardinality. A typical small cluster uses 2-4 GB RAM for Prometheus. The manifests include resource requests and limits for all components.

Q: Does it support long-term metric storage? A: kube-prometheus uses local Prometheus storage by default. For long-term retention, integrate with Thanos or Cortex as a remote write backend.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产