1、日志报错

rancher导入k8s集群后添加监控无数据,rancher日志报错:

k8s.io/kube-state-metrics/pkg/collectors/builder.go:: Failed to list *v1beta1.PodDisruptionBudget: poddisruptionbudgets.policy is forbidden: User "system:serviceaccount:cattle-prometheus:exporter-kube-state-cluster-monitoring" cannot list resource "poddisruptionbudgets" in API group "policy" at the cluster scope

2、原因

原因:是因为没有对 poddisruptionbudgets 源进行授权。

3、解决

参考:https://github.com/thxCode/rancher-system-charts/commit/48076079df0864489a669cea0380590f5dfca282

1)先查看 exporter-kube-state-cluster-monitoring 容器的 yaml 配置文件,是否含有 poddisruptionbudgets 源的权限定义:

kubectl -n cattle-prometheus get clusterrole/exporter-kube-state-cluster-monitoring -o yaml

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: "2019-05-24T07:07:04Z"
labels:
app: exporter-kube-state
chart: exporter-kube-state-0.0.
heritage: Tiller
io.cattle.field/appId: cluster-monitoring
release: cluster-monitoring
name: exporter-kube-state-cluster-monitoring
resourceVersion: ""
selfLink: /apis/rbac.authorization.k8s.io/v1/clusterroles/exporter-kube-state-cluster-monitoring
uid: 88e7bfe7-7df2-11e9-b769-0232e60a22fc
rules:
- apiGroups:
- ""
resources:
- namespaces
- nodes
- pods
- services
- resourcequotas
- replicationcontrollers
- limitranges
- persistentvolumeclaims
- persistentvolumes
- endpoints
- configmaps
- secrets
verbs:
- list
- watch
- apiGroups:
- extensions
resources:
- daemonsets
- deployments
- replicasets
verbs:
- list
- watch
- apiGroups:
- apps
resources:
- statefulsets
- deployments
verbs:
- list
- watch
- apiGroups:
- batch
resources:
- cronjobs
- jobs
verbs:
- list
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- list
- watch

2)发现没有相关配置,则先导出配置文件:

kubectl -n cattle-prometheus get clusterrole/exporter-kube-state-cluster-monitoring -o yaml >kube-state-ClusterRole.yaml

3)然后在最后面添加:

- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- list
- watch

4)再应用配置

kubectl apply -f kube-state-ClusterRole.yaml

5)最后可以看到图表了:

rancher导入k8s集群后添加监控无数据的更多相关文章

  1. 关于使用rancher部署k8s集群的一些小问题的解决

    问题一: 在rancher的ui上,不能创建k8s的master节点的高可用集群.创建k8s集群,添加节点的时候,可以添加多个master,但是多个master又没有高可用,只要其中一个出问题了,那么 ...

  2. 基于k8s集群部署prometheus监控ingress nginx

    目录 基于k8s集群部署prometheus监控ingress nginx 1.背景和环境概述 2.修改prometheus配置 3.检查是否生效 4.配置grafana图形 基于k8s集群部署pro ...

  3. 基于k8s集群部署prometheus监控etcd

    目录 基于k8s集群部署prometheus监控etcd 1.背景和环境概述 2.修改prometheus配置 3.检查是否生效 4.配置grafana图形 基于k8s集群部署prometheus监控 ...

  4. 安装rancher以及使用rancher倒入kubernetes集群和添加及管理集群

    1.docker安装rancher [root@rancher ~]# docker run -d --name rancher --restart=unless-stopped -p : -p : ...

  5. 如何在 Serverless K8s 集群中低成本运行 Spark 数据计算?

    作者 | 柳密 阿里巴巴阿里云智能 ** 本文整理自<Serverless 技术公开课>,关注"Serverless"公众号,回复"入门",即可获取 ...

  6. 使用KubeOperator安装k8s集群后,节点主机yaml文件路径

    [root@k8s-develop-master-1 kubernetes]# cd /etc/kubernetes [root@k8s-develop-master-1 kubernetes]# l ...

  7. 强大多云混合多K8S集群管理平台Rancher入门实战

    @ 目录 概述 定义 为何使用 其他产品 安装 简述 规划 基础环境 Docker安装 Rancher安装 创建用户 创建集群 添加Node节点 配置kubectl 创建项目和名称空间 发布应用 偏好 ...

  8. Rancher 下图形界面 搭建 K8S 集群

    首先我们准备4台 2核3G 的 centos 7 温馨提示:先安装好一台 CentOS 的虚拟机,并且安装好 docker,永久关闭防火墙. 再这个基础上我们分别克隆出四台 Rancher.K8S1. ...

  9. 案例分享 生产环境逐步迁移至k8s集群 - pod注册到consul

    #案例分享 生产环境逐步迁移至k8s集群 - pod注册到consul #项目背景 多套业务系统, 所有节点注册到consul集群,方便统一管理 使用consul的dns功能, 所有节点hostnam ...

随机推荐

  1. HDU_4826_dp

    Labyrinth Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

  2. antiSMASH数据库:微生物次生代谢物合成基因组簇查询和预测

    2017年4月28日,核酸研究(Nucleic Acids Research)杂志上,在线公布了一个可搜索微生物次生代谢物合成基因组簇的综合性数据库antiSMASH数据库 4.0版,前3版年均引用2 ...

  3. CStatic设置位图

    CStatic 用于显示位图 如果要显示图标,则必须要设置窗口属性为 SS_BITMAP 和 SS_CENTERIMAGE,实例代码如下: //获得指向静态控件的指针 CStatic *pStatic ...

  4. logback日志配置文件

    application.properties application.properties logback-spring.xml <?xml version="1.0" en ...

  5. 北京Python开发培训怎么选?

    北京的地理优势和经济优势基本无需多言,作为全国机会最多的地方,吸引了无数的北漂前赴后继.作为中国互联网中心之一,北京有海量Python岗位正在等待大家淘金. 近几年中,Python一直是市场上最受欢迎 ...

  6. swift--如何设置子视图alpha不同于父视图

    //1.2加入商家标题评分容器 let titleWarp=UIView(frame: CGRectMake(, , screenObject.width, )); titleWarp.backgro ...

  7. 【转载】Apache shutdown unexpectedly启动错误解决方法

    http://blog.csdn.net/dong123dddd/article/details/21372179 xampp启动时显示的错误为: 9:52:41  [Apache] Attempti ...

  8. 7.2.1 代码测试 doctest

    Python标准库 doctest 可以搜索程序中类似于交互式Python代码的文本片段,并运行这些交互式代码来验证是否符合预期结果和功能,常用于Python程序的模块测试. 使用doctest模块测 ...

  9. chromeDriver下载地址

    http://chromedriver.storage.googleapis.com/index.html

  10. [JZOJ4687]奇袭

    [JZOJ4687]奇袭 题目 由于各种原因,桐人现在被困在Under World(以下简称UW)中,而UW马上要迎来最终的压力测试——魔界入侵. 唯一一个神一般存在的Administrator被消灭 ...