From 534ed26f885627cc15427d0c3cb69f6d10e89486 Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Wed, 27 Aug 2025 02:22:03 +0000 Subject: [PATCH] Update README.md --- README.en.md | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 276 insertions(+) create mode 100644 README.en.md create mode 100644 README.md diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..e389ba4 --- /dev/null +++ b/README.en.md @@ -0,0 +1,138 @@ +# kube-prometheus Project README + +## Overview + +`kube-prometheus` is a collection of Helm charts for deploying and managing the Prometheus monitoring stack in a Kubernetes cluster. This project provides a complete monitoring solution for Prometheus, Alertmanager, Grafana, and other related components, suitable for monitoring needs in production environments. + +## Component List + +- **Prometheus**: Used for collecting and storing monitoring metrics. +- **Alertmanager**: Responsible for receiving alert notifications from Prometheus and performing grouping, deduplication, routing, and other processing. +- **Grafana**: Provides dashboards for visualizing monitoring data. +- **Node Exporter**: Collects system-level metrics (CPU, memory, disk, etc.) of Kubernetes nodes. +- **kube-state-metrics**: Provides metrics about the state of Kubernetes objects. +- **Prometheus Operator**: Simplifies the deployment and management of Prometheus and Alertmanager. +- **Pushgateway**: Used for collecting metrics from short-lived or batch jobs. +- **Various Exporters**: Includes monitoring exporters for databases and middleware such as MySQL, Redis, PostgreSQL, SNMP, and Blackbox. + +## Installation + +### Prerequisites + +- Kubernetes cluster (version 1.20 or higher) +- Helm 3.x +- Cluster administrator privileges (for installing CRDs and RBAC) + +### Installation Steps + +1. Add the Helm repository (if not already added): + + ```bash + helm repo add prometheus-community https://prometheus-community.github.io/helm-charts + helm repo update + ``` + +2. Install kube-prometheus-stack: + + ```bash + helm install [RELEASE_NAME] prometheus-community/kube-prometheus-stack + ``` + + > `RELEASE_NAME` is the name you specify for this deployment, for example `prometheus-monitoring`. + +3. View deployment status: + + ```bash + kubectl get pods -l "app.kubernetes.io/instance=[RELEASE_NAME]" + ``` + +## Uninstallation + +To uninstall kube-prometheus: + +```bash +helm delete [RELEASE_NAME] +``` + +This will remove all Kubernetes resources associated with the Helm release. + +## Upgrade + +### Upgrading to a New Version + +Make sure to update the Helm repository: + +```bash +helm repo update +``` + +Then use the following command to upgrade: + +```bash +helm upgrade [RELEASE_NAME] prometheus-community/kube-prometheus-stack +``` + +### Major Version Upgrade + +When upgrading to a new major version, please refer to the [UPGRADE.md](UPGRADE.md) file, which contains significant changes between versions and migration guides. + +## Configuration + +`kube-prometheus` provides rich configuration options that can be customized through the `values.yaml` file. Key configurations include: + +- Number of replicas and storage and persistence settings for Prometheus and Alertmanager +- Access methods and persistence configurations for Grafana +- Enable/disable status of various exporters +- Custom alert rules and dashboard configurations +- RBAC and security policy configurations + +You can deploy using a custom `values.yaml` file via the `--values` parameter: + +```bash +helm install [RELEASE_NAME] prometheus-community/kube-prometheus-stack --values your-values.yaml +``` + +## Usage + +### Accessing the Prometheus Web UI + +You can access the Prometheus UI via the Kubernetes Service: + +```bash +kubectl port-forward svc/[RELEASE_NAME]-kube-prometheus-sta-prometheus 9090 +``` + +Then access `http://localhost:9090` via your browser. + +### Accessing Grafana + +Grafana is exposed via a Service by default, and you can access it using the following command: + +```bash +kubectl port-forward svc/[RELEASE_NAME]-grafana 3000 +``` + +The default login credentials are: + +- Username: `admin` +- Password: `prom-operator` (can be changed in `values.yaml`) + +### Configuring Alert Rules + +Alert rules can be configured through the PrometheusRule custom resource. You can define your own alert rules in `values.yaml` or mount them via a ConfigMap. + +### Configuring Dashboards + +Grafana dashboards can be mounted via ConfigMap or preloaded during deployment through configuration in `values.yaml`. + +## Contributions + +Community contributions are welcome! If you'd like to contribute to this project, please refer to [CONTRIBUTING.md](CONTRIBUTING.md). + +## License + +This project uses the [Apache 2.0 License](LICENSE). Please ensure compliance with this license when using and distributing the software. + +## Support + +If you encounter any issues or need assistance, please open an issue on the GitHub repository or visit the Prometheus community forum. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5b78c6f --- /dev/null +++ b/README.md @@ -0,0 +1,138 @@ +# kube-prometheus 项目 README + +## 概述 + +`kube-prometheus` 是一个用于在 Kubernetes 集群中部署和管理 Prometheus 监控栈的 Helm Chart 集合。该项目提供了对 Prometheus、Alertmanager、Grafana 以及其他相关组件的完整监控解决方案,适用于生产环境的监控需求。 + +## 组件列表 + +- **Prometheus**: 用于采集和存储监控指标。 +- **Alertmanager**: 负责接收 Prometheus 的告警通知,并进行分组、去重、路由等处理。 +- **Grafana**: 提供可视化监控数据的仪表盘。 +- **Node Exporter**: 收集 Kubernetes 节点的系统级指标(CPU、内存、磁盘等)。 +- **kube-state-metrics**: 提供 Kubernetes 对象状态的指标。 +- **Prometheus Operator**: 简化 Prometheus 和 Alertmanager 的部署和管理。 +- **Pushgateway**: 用于短期任务或批处理任务的监控指标收集。 +- **各种 Exporter**: 包括 MySQL、Redis、PostgreSQL、SNMP、Blackbox 等数据库和中间件的监控 Exporter。 + +## 安装 + +### 前提条件 + +- Kubernetes 集群(1.20 或更高版本) +- Helm 3.x +- 具备集群管理员权限(用于安装 CRD 和 RBAC) + +### 安装步骤 + +1. 添加 Helm 仓库(如果尚未添加): + + ```bash + helm repo add prometheus-community https://prometheus-community.github.io/helm-charts + helm repo update + ``` + +2. 安装 kube-prometheus-stack: + + ```bash + helm install [RELEASE_NAME] prometheus-community/kube-prometheus-stack + ``` + + > `RELEASE_NAME` 是你为这个部署指定的名称,例如 `prometheus-monitoring`。 + +3. 查看部署状态: + + ```bash + kubectl get pods -l "app.kubernetes.io/instance=[RELEASE_NAME]" + ``` + +## 卸载 + +要卸载 kube-prometheus: + +```bash +helm delete [RELEASE_NAME] +``` + +这将删除与该 Helm Release 关联的所有 Kubernetes 资源。 + +## 升级 + +### 升级到新版本 + +确保更新 Helm 仓库: + +```bash +helm repo update +``` + +然后使用以下命令升级: + +```bash +helm upgrade [RELEASE_NAME] prometheus-community/kube-prometheus-stack +``` + +### 重大版本升级 + +升级到新的主要版本时,请参考 [UPGRADE.md](UPGRADE.md) 文件,其中包含了版本间的重大变更和迁移指南。 + +## 配置 + +`kube-prometheus` 提供了丰富的配置选项,可以通过 `values.yaml` 文件进行定制。主要配置包括: + +- Prometheus 和 Alertmanager 的副本数、存储配置、持久化设置等 +- Grafana 的访问方式和持久化配置 +- 各种 Exporter 的启用/禁用状态 +- 告警规则和仪表盘的自定义配置 +- RBAC 和安全策略配置 + +你可以通过 `--values` 参数指定自定义的 `values.yaml` 文件进行部署: + +```bash +helm install [RELEASE_NAME] prometheus-community/kube-prometheus-stack --values your-values.yaml +``` + +## 使用 + +### 访问 Prometheus Web UI + +可以通过 Kubernetes Service 访问 Prometheus UI: + +```bash +kubectl port-forward svc/[RELEASE_NAME]-kube-prometheus-sta-prometheus 9090 +``` + +然后在浏览器中访问 `http://localhost:9090`。 + +### 访问 Grafana + +Grafana 默认使用 Service 暴露端口,可以通过以下命令访问: + +```bash +kubectl port-forward svc/[RELEASE_NAME]-grafana 3000 +``` + +默认登录凭据为: + +- 用户名:`admin` +- 密码:`prom-operator`(可在 `values.yaml` 中更改) + +### 配置告警规则 + +告警规则可以通过 PrometheusRule 自定义资源进行配置。你可以在 `values.yaml` 中定义自己的告警规则,或者通过 ConfigMap 挂载。 + +### 配置仪表盘 + +Grafana 仪表盘可以通过 ConfigMap 挂载,也可以在部署时通过 `values.yaml` 配置预加载仪表盘。 + +## 贡献 + +欢迎社区贡献!如果你希望为该项目做出贡献,请参考 [CONTRIBUTING.md](CONTRIBUTING.md)。 + +## 许可证 + +该项目使用 [Apache 2.0 License](LICENSE)。请确保在使用和分发时遵守该许可证。 + +## 支持 + +如果你遇到问题或需要帮助,请在 GitHub 仓库中提交 Issue 或访问 Prometheus 社区论坛。 \ No newline at end of file -- Gitee