# helm-study **Repository Path**: andrewgithub/helm-study ## Basic Information - **Project Name**: helm-study - **Description**: 一个专注于Helm学习与实践的开源项目,提供Kubernetes应用部署的示例和最佳实践,适合初学者和高级用户。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-08-27 - **Last Updated**: 2025-08-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 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.