rancher上kube-prometheus部署报错处理

琉璃3年前技术文章3867

问题描述

rancher 上安装kube-prometheus,版本:8.3.9  ,Chart 仓库:bitnami

image.png

服务 pod: prometheus-kube-prometheus-prometheus 启动异常

image.png

问题处理

kubectl  describe po -n monitoring  prometheus-kube-prometheus-prometheus-0

报错如下:

caller=main.go:468 level=error msg="Error loading config (--config.file=/etc/prometheus/config_out/prometheus.env.yaml)" file=/etc/prometheus/config_out/prometheus.env.yaml err="parsing YAML file /etc/prometheus/config_out/prometheus.env.yaml: empty duration string"

image.png

查看具体报错信息:

kubectl  describe po -n monitoring  prometheus-kube-prometheus-prometheus-0   | grep  /etc/prometheus/config_out/prometheus.env.yaml

image.png

查看挂载信息

image.png

查看卷信息 ,config-out Type类型为 EmptyDir
备注:

emptyDir类型的volume在pod分配到node上时被创建,kubernetes会在node上自动分配 一个目录,因此无需指定宿主机node上对应的目录文件。这个目录的初始内容为空,当Pod从node上移除时,emptyDir中的数据会被永久删除。

image.png


查看在宿主机上EmptyDir映射信息

image.png

image.png

docker inspect 8ce86e673faa

image.png


cd /var/lib/kubelet/pods/878476b9-4d09-4aca-a2b4-2e3fcc85ed57/volumes/kubernetes.io~empty-dir/config-out

image.png


github 查询资料发现此issues:

What steps will reproduce the bug?

  1. deploy chart v8.2.1+

  2. see error and restarting prometheus pod

it seems setting these values fixes the issue:

在values中添加如下scrapeInterval 、evaluationInterval 值

prometheus:

 scrapeInterval: 1m

 evaluationInterval: 1m

Prometheus以scrape_interval规则周期性从监控目标上收集数据,然后将数据存储到本地存储上。

Prometheus以evaluation_interval规则周期性对告警规则做计算,然后更新告警状态。

 # 评估告警周期   evaluation_interval

# 数据采集间隔   scrape_interval

添加完成后服务正常启动

image.png



image.png


image.png

参考文档:https://github.com/bitnami/charts/issues/13874


相关文章

Yarn界面详解

Yarn界面详解

1.Active Nodes:表示Yarn集群管理的节点的个数,其实就是NodeManager的个数,集群有2个NodeManager从配置中可以看到每一个NodeManager管理的内存大小是163...

虚拟机三种网络模式详解

虚拟机三种网络模式详解

在电脑里开一台虚拟机,是再常见不过的操作了。无论是用虚拟机玩只有旧版本系统能运行的游戏,还是用来学习Linux、跑跑应用程序都是很好的。而这其中,虚拟机网络是绝对绕不过去的。本篇文章通俗易懂的介绍了常...

PostgreSQL 源码部署

PostgreSQL 源码部署

说明本篇文章介绍 PostgreSQL 单机源码编译部署的详细步骤。1. 准备工作1.1 源码包下载进入 PostgreSQL 官网下载页面  选择 Source 栏目: 接着就进入源码版本目录,选择...

apache Kyuubi部署及对接hive

apache Kyuubi部署及对接hive

1、背景客户重度使用spark sql,但是使用spark thriftserver存在各种各样的问题,我们选择使用kyuubi来替代spark thriftserver的使用2、安装包下载下载地址:...

MySQL运维实战(4.5) SQL_MODE之NO_ZERO_DATE和NO_ZERO_IN_DATE

NO_ZERO_DATE:日期中不允许'0000-00-00'NO_ZERO_IN_DATE:日期中年、月或日不允许为0,如不允许'2021-00-01', '...

CDP实操(7.1.4版本)--RangerAdmin使用负载均衡实现高可用

CDP实操(7.1.4版本)--RangerAdmin使用负载均衡实现高可用

本文主要是通过配置外部负载平衡器,实现 Ranger HA。1、在 Cloudera Manager 中,选择 Ranger,然后选择Actions > Add Role Instances。2...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。