赞
踩
目录
7、将 alertmanager-main 、grafana、prometheus-k8s的端口暴露出来
部署k8集群参考使用kubeadm方式部署集群-CSDN博客
名称 | 配置 | 版本 | 系统版本 |
---|---|---|---|
master | 4核8G | 1.20.1 | centos7.9 |
node1 | 2核4G | 1.20.1 | centos7.9 |
node2 | 2核4G | 1.20.1 | centos7.9 |
在k8s中部署prometheus所需的镜像已打包上传
- docker pull quay.io/prometheus/alertmanager:v0.21.0
- docker pull quay.io/prometheus/blackbox-exporter:v0.18.0
- docker pull jimmidyson/configmap-reload:v0.5.0
- docker pull quay.io/brancz/kube-rbac-proxy:v0.9.0
- docker pull grafana/grafana:7.5.4
- docker pull k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.1.1
- docker pull quay.io/prometheus/node-exporter:v1.1.2
- docker pull k8s.gcr.io/prometheus-adapter/prometheus-adapter:v0.9.0
- docker pull quay.io/prometheus/prometheus:v2.26.0
- docker pull quay.io/prometheus-operator/prometheus-operator:v0.47.0
- [root@k8s-master ~]# wget https://codeload.github.com/prometheus-operator/kube-prometheus/tar.gz/refs/tags/v0.9.0
- [root@k8s-master ~]# tar xf v0.9.0
- [root@k8s-master ~]# cd kube-prometheus-0.9.0/manifests
- [root@k8s-master ~]# kubectl apply -f setup/
- [root@k8s-master ~]# kubectl get pods -n monitoring # 查看pod全部RUNNING之后再执行后面指令
- [root@k8s-master ~]# kubectl apply -f .
- [root@k8s-master ~]# kubectl get pods -n monitoring # 等待podRUNNING
- [root@k8s-master ~]# kubectl get apiservices -n monitoring | grep metrics
- v1beta1.metrics.k8s.io monitoring/prometheus-adapter True 3h52m
[root@kube-master manifests]# kubectl edit svc -n monitoring alertmanager-main
同样的方法将grafana、prometheus-k8s也修改
端口已暴露
导入监控模板
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。