#登录master节点操作
1、进入prometheus介质目录:
[root@k8s-master01]$ cd /yang/operator/operator-0.7/manifests/prometheus
2、备份prometheus配置文件
[root@k8s-master01]$cp prometheus-prometheus.yaml prometheus-prometheus.yaml.20231215
3、编辑prometheus配置文件修改相关参数
scrapeInterval: 30s
scrapeTimeout: 30s
evaluationInterval: 30s
4、更新prometheus配置
[root@k8s-master01]$ kubectl apply -f prometheus-prometheus.yaml
5、重启prometheus加载配置文件
[root@k8s-master01]$ kubectl rollout restart sts prometheus-k8s -n monitoring
6、检查prometheus的pod状态
kubectl -n monitoring get pod
7、检查配置是否生效
访问prometheus WEB界面点击“Status”--->“Configuration”,查看配置是否生效
标签:kubectl,K8s,配置文件,master01,prometheus,Prometheus,k8s,root From: https://www.cnblogs.com/A121/p/17967890