Helm Install Prometheus
- 参考链接
https://github.com/prometheus-community/helm-charts
Usage
Helm must be installed to use the charts. Please refer to Helm's documentation to get started.
Once Helm is set up properly, add the repo as follows:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
You can then run helm search repo prometheus-community
to see the charts.
NAME: monitoring
LAST DEPLOYED: Thu Aug 18 22:11:43 2022
NAMESPACE: monitoring
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
The Prometheus server can be accessed via port 80 on the following DNS name from within your cluster:
monitoring-prometheus-server.monitoring.svc.cluster.local
Get the Prometheus server URL by running these commands in the same shell:
export POD_NAME=$(kubectl get pods --namespace monitoring -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace monitoring port-forward $POD_NAME 9090
The Prometheus alertmanager can be accessed via port 80 on the following DNS name from within your cluster:
monitoring-prometheus-alertmanager.monitoring.svc.cluster.local
Get the Alertmanager URL by running these commands in the same shell:
export POD_NAME=$(kubectl get pods --namespace monitoring -l "app=prometheus,component=alertmanager" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace monitoring port-forward $POD_NAME 9093
#################################################################################
###### WARNING: Pod Security Policy has been moved to a global property. #####
###### use .Values.podSecurityPolicy.enabled with pod-based #####
###### annotations #####
###### (e.g. .Values.nodeExporter.podSecurityPolicy.annotations) #####
#################################################################################
The Prometheus PushGateway can be accessed via port 9091 on the following DNS name from within your cluster:
monitoring-prometheus-pushgateway.monitoring.svc.cluster.local
Get the PushGateway URL by running these commands in the same shell:
export POD_NAME=$(kubectl get pods --namespace monitoring -l "app=prometheus,component=pushgateway" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace monitoring port-forward $POD_NAME 9091
For more information on running Prometheus, visit:
https://prometheus.io/
MySQL
[root@Master 005.Prometheus]# helm install prometheus-mysql prometheus-community/prometheus-mysql-exporter -n monitoring
NAME: prometheus-mysql
LAST DEPLOYED: Thu Aug 18 23:07:15 2022
NAMESPACE: monitoring
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Get the application URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace monitoring -l "app.kubernetes.io/name=prometheus-mysql-exporter,app.kubernetes.io/instance=prometheus-mysql" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:9104 to use your application"
kubectl --namespace monitoring port-forward $POD_NAME 9104
Redis
[root@Master 005.Prometheus]# helm install prometheus-redis prometheus-community/prometheus-redis-exporter -n monitoring
W0818 23:09:25.610247 10775 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+
W0818 23:09:25.640420 10775 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+
NAME: prometheus-redis
LAST DEPLOYED: Thu Aug 18 23:09:25 2022
NAMESPACE: monitoring
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Get the Redis Exporter URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace monitoring -l "app=prometheus-redis-exporter,release=prometheus-redis" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:
RabbitMQ
[root@Master 005.Prometheus]# helm install prometheus-rabbitmq prometheus-community/prometheus-rabbitmq-exporter -n monitoring
NAME: prometheus-rabbitmq
LAST DEPLOYED: Thu Aug 18 23:11:12 2022
NAMESPACE: monitoring
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Get the application URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace monitoring -l "app=prometheus-rabbitmq-exporter,release=prometheus-rabbitmq" -o jsonpath="{.items[0].metadata.name}")
kubectl port-forward $POD_NAME 8080:9419
echo "Visit http://127.0.0.1:8080 to use your application"
Elasticsearch
[root@Master 005.Prometheus]# helm install prometheus-elasticsearch prometheus-community/prometheus-elasticsearch-exporter -n monitoring
NAME: prometheus-elasticsearch
LAST DEPLOYED: Thu Aug 18 23:13:14 2022
NAMESPACE: monitoring
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Get the application URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace monitoring -l "app=prometheus-elasticsearch-prometheus-elasticsearch-exporter" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:9108/metrics to use your application"
kubectl port-forward $POD_NAME 9108:9108 --namespace monitoring
评论区