这个系列的东东满多的。要另开系列说明。

这里为了内容连续完成,先贴一个吧,其它configmap,exporter就不展示。

为了保持统一,将prometheus也放到二级目录了。

- '--web.external-url=/prometheus'

apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
  name: prometheus
rules:
  - apiGroups: [""] # "" indicates the core API group
    resources:
      - nodes
      - nodes/proxy
      - services
      - endpoints
      - pods
    verbs:
      - get
      - watch
      - list
  - apiGroups:
      - extensions
    resources:
      - ingresses
    verbs:
      - get
      - watch
      - list
  - nonResourceURLs: ["/metrics"]
    verbs:
      - get
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: prometheus
  namespace: kube-system
  labels:
    app: prometheus
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: prometheus
subjects:
  - kind: ServiceAccount
    name: prometheus
    namespace: kube-system
roleRef:
  kind: ClusterRole
  name: prometheus
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: prometheus
  namespace: kube-system
  labels:
    app: prometheus
spec:
  replicas: 1
  template:
    metadata:
      name: prometheus
      labels:
        app: prometheus
    spec:
#      hostNetwork: true
      serviceAccountName: prometheus
      containers:
      - name: prometheus
        image: harbor.xxx.cn/3rd_part/prom/prometheus:v2.9.2
        imagePullPolicy: IfNotPresent
        args:
          - '--storage.tsdb.path=/prometheus/data/'
          - '--storage.tsdb.retention=1d'
          - '--config.file=/etc/prometheus/prometheus.yaml'
          - '--web.enable-lifecycle'
          - '--web.external-url=/prometheus'
        ports:
        - name: webui
          containerPort: 9090
        resources:
          requests:
            cpu: 401m
            memory: 500M
        #  limits:
        #    cpu: 500m
        #    memory: 500M
        volumeMounts:
        - name: config-volume
          mountPath: /etc/prometheus
        - name: rules-volume
          mountPath: /etc/prometheus-rules
      volumes:
      - name: config-volume
        configMap:
          name: prometheus
      - name: rules-volume
        configMap:
          name: prometheus-rules
      nodeSelector:
        node-role.kubernetes.io/master: ""
      tolerations:
      - key: "node-role.kubernetes.io/master"
        effect: "NoSchedule"
---
apiVersion: v1
kind: Service
metadata:
  name: prometheus
  namespace: kube-system
  labels:
    app: prometheus
  annotations:
    prometheus.io/scrape: 'true'
spec:
  ports:
    - name: webui
      port: 9090
      protocol: TCP
  selector:
    app: prometheus

k8s安装之prometheus.yaml的更多相关文章

  1. k8s安装之kube-state-metrics.yaml

    概述 已经有了cadvisor.heapster.metric-server,几乎容器运行的所有指标都能拿到,但是下面这种情况却无能为力: 我调度了多少个replicas?现在可用的有几个? 多少个P ...

  2. k8s安装之nginx.yaml

    这里两个nginx.一个是用来测试最简单的集群的. 另一个是用来作grafana,prometheus,dashboard前端安全展示的. 简单版 apiVersion: apps/v1 kind: ...

  3. k8s安装之dashboard.yaml

    这个我使用了nodeport方式导出来. 为了安装,最好在前面加个nginx作密码验证... 这个端口,可以通过防火墙禁掉. # Copyright 2017 The Kubernetes Autho ...

  4. k8s安装之calico.yaml

    这个calico有点长,我也没有仔细看完. 但部署上去是可用的. 如果节点超过200台,那最好要另外一套配置... 而对于我们,差不多下面的配置够用了. veth_mtu: "1440&qu ...

  5. k8s安装之node-autoapprove-certificate-server.yaml

    kubelet证书分为server和client两种, k8s 1.9默认启用了client证书的自动轮换,但server证书自动轮换需要用户开启.方法是: 2.1 增加 kubelet 参数(现已默 ...

  6. k8s安装之eventrouter.yaml

    k8s的heapster项目中止以后, 事件收集的项目,就推荐使用https://github.com/heptiolabs/eventrouter项目了 Eventrouter This repos ...

  7. k8s安装之flannel.yaml

    收藏一下,以后直接从这里cp过来用的. flannel新版 --- apiVersion: extensions/v1beta1 kind: PodSecurityPolicy metadata: n ...

  8. k8s安装之grafana.yaml

    这个作展示,够用. 为了使用nginx统一管理, 这里将grafana放在子目录下. - name: GF_SERVER_ROOT_URL  value: "%(protocol)s://% ...

  9. k8s 安装 prometheus 过程记录

    开始以为只要安装 prometheus-operator 就行了. git clone https://github.com/coreos/prometheus-operator.git cd pro ...

随机推荐

  1. JIT(just in time)即时编译器

    JIT(just in time) 前端vs后端 在编译原理中,通常将编译分为前端和后端.其中前端会对程序进行词法分析.语法分析.语义分析,然后生成一个中间表达形式(称为IR:Intermediate ...

  2. 阿里云移动推送 ios项目添加SDK步骤

    添加阿里云Pods仓库和各产品SDK Pod依赖,配置步骤如下: 1. CocoaPods集成添加阿里云Pods仓库,Podfile添加: source 'https://github.com/ali ...

  3. windows server 守护进程nssm

    安装nssm 下载程序 https://nssm.cc/ci/nssm-2.24-101-g897c7ad.zip 安装nssm,以管理员运行cmd.exe,执行如下: C:\Users\prolds ...

  4. 面试之leetcode20堆栈-字符串括号匹配,队列实现栈

    1 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效. 有效字符串需满足: 左括号必须用相同类型的右括号闭合.左括号必须以正确的顺序闭合.注意空字符串可被认 ...

  5. ActiveMQ学习教程

    一.activemq安装 官网地址:https://activemq.apache.org/ 具体安装过程不赘述,解压即安装, 二.使用 activemq有queue和topic两种模式, 我们以qu ...

  6. SpringBoot配置文件敏感信息加密-jasypt

    使用过SpringBoot配置文件的朋友都知道,资源文件中的内容通常情况下是明文显示,安全性就比较低一些.打开application.properties或application.yml,比如mysq ...

  7. spring框架学习(二)——注解方式IOC/DI

    什么是注解 传统的Spring做法是使用.xml文件来对bean进行注入或者是配置aop.事物,这么做有两个缺点: 1.如果所有的内容都配置在.xml文件中,那么.xml文件将会十分庞大:如果按需求分 ...

  8. C++ 读取 MATLAB 的 .m 文件,并发送到 MATLAB 运行

    本代码是由「Microsoft Visual Studio 2015 Enterprise」编写. 想要了解更多 C++ 与 MATLAB 混合编程的知识,可以参考我的另一篇博客:C++ 与 MATL ...

  9. Wing-AEP平台LWM2M设备接入

    实现Wing-AEP中国电信物联网开放平台,LWM2M设备接入 一.准备 接入模组:BC35-G 平台地址:https://www.ctwing.cn/ 点击右上角控制台 点击左侧栏点击产品中心 二. ...

  10. [洛谷P4052][JSOI2007]文本生成器

    题目大意:有$n$个字符串$s_i$,问有多少个长度为$m$的字符串至少包含$n$个字符串中的一个,字符集 A-Z .$s_i,m\leqslant100,n\leqslant60$ 题解:$AC$自 ...