← Back to list
2026-04-30T13:29:54.043ZLinuxPrometheus

搭建Prometheus 0.13.0

搭建Prometheus

  1. 下载dashboard配置文件
wget https://resource-obsbothk.com/Soft/K8S/prometheus/kube-prometheus-0.13.0.tar.gz
tar -zxvf kube-prometheus-0.13.0.zip  
cd kube-prometheus-0.13.0
  1. 修改镜像源地址
  • 如果没有vpn,需要修改对应服务的镜像,manifests/ 文件夹下面所有的deployment yaml 文件
  1. 修改prometheus service
  • manifests/prometheus-service.yaml
# 设置对外访问端口,增加如下两行
type: NodePort
nodePort: 31922

《搭建Prometheus 0.13.0》文章正文配图 — STARBUCKET BLOG

  1. 修改 Grafana 的 service
  • manifests/grafana-service.yaml
# 设置对外访问端口,增加如下两行
type: NodePort
nodePort: 30300

《搭建Prometheus 0.13.0》文章正文配图(配图 2)— STARBUCKET BLOG

  1. 修改 Alertmanager 的 service
  • manifests/alertmanager-service.yaml
# 设置对外访问端口,增加如下两行
type: NodePort
nodePort: 30200

《搭建Prometheus 0.13.0》文章正文配图(配图 3)— STARBUCKET BLOG

  1. 安装prometheus
kubectl apply --server-side -f manifests/setup
kubectl apply -f manifests/
  • 执行完成以后,访问monitoring 空间,查看部署状态,可以看到启动成功,并且都是高可用部署
kubectl get pods,svc -n monitoring
  1. 验证Prometheus服务连通性
  • Prometheus: IP+31922
  • Alertmanager: IP+30200
  • Grafana: IP+30300
  1. 卸载Prometheus
kubectl delete --ignore-not-found=true -f manifests/ -f manifests/setup

Comments & discussion

The first comment in each thread opens a topic. Signed-in readers can keep the conversation going under that topic.

No comments yet. Sign in to start a topic.

Start a new topic

Sign in to start a topic or join the discussion.