一键部署命令
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install prometheus prometheus-community/kube-prometheus-stack
暴露服务
- 使用port-forward
kubectl port-forward --address 0.0.0.0 deployment/prometheus-grafana 3000
- 使用ingress
cat grafana-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: grafana-ingress
spec:
defaultBackend:
service:
name: prometheus-grafana
port:
number: 80
使用浏览器登录
username: admin
password: prom-operator
参考文档
Install Prometheus and Grafana on Kubernetes using Helm (k21academy.com)
https://k21academy.com/docker-kubernetes/prometheus-grafana-monitoring/