k8s安装之prometheus.yaml
这个系列的东东满多的。要另开系列说明。
这里为了内容连续完成,先贴一个吧,其它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的更多相关文章
- k8s安装之kube-state-metrics.yaml
概述 已经有了cadvisor.heapster.metric-server,几乎容器运行的所有指标都能拿到,但是下面这种情况却无能为力: 我调度了多少个replicas?现在可用的有几个? 多少个P ...
- k8s安装之nginx.yaml
这里两个nginx.一个是用来测试最简单的集群的. 另一个是用来作grafana,prometheus,dashboard前端安全展示的. 简单版 apiVersion: apps/v1 kind: ...
- k8s安装之dashboard.yaml
这个我使用了nodeport方式导出来. 为了安装,最好在前面加个nginx作密码验证... 这个端口,可以通过防火墙禁掉. # Copyright 2017 The Kubernetes Autho ...
- k8s安装之calico.yaml
这个calico有点长,我也没有仔细看完. 但部署上去是可用的. 如果节点超过200台,那最好要另外一套配置... 而对于我们,差不多下面的配置够用了. veth_mtu: "1440&qu ...
- k8s安装之node-autoapprove-certificate-server.yaml
kubelet证书分为server和client两种, k8s 1.9默认启用了client证书的自动轮换,但server证书自动轮换需要用户开启.方法是: 2.1 增加 kubelet 参数(现已默 ...
- k8s安装之eventrouter.yaml
k8s的heapster项目中止以后, 事件收集的项目,就推荐使用https://github.com/heptiolabs/eventrouter项目了 Eventrouter This repos ...
- k8s安装之flannel.yaml
收藏一下,以后直接从这里cp过来用的. flannel新版 --- apiVersion: extensions/v1beta1 kind: PodSecurityPolicy metadata: n ...
- k8s安装之grafana.yaml
这个作展示,够用. 为了使用nginx统一管理, 这里将grafana放在子目录下. - name: GF_SERVER_ROOT_URL value: "%(protocol)s://% ...
- k8s 安装 prometheus 过程记录
开始以为只要安装 prometheus-operator 就行了. git clone https://github.com/coreos/prometheus-operator.git cd pro ...
随机推荐
- Java分布式定时任务
分布式定时任务 elastic-job 可以实现任务分片 quartz 可以把任务存入数据库,实时生成任务(添加数据库添加定时任务) 文档 中文翻译 翻译2
- odoo - 自定义默认主页
- SQL——BETWEEN操作符
一.BETWEEN操作符的基本用法 BETWEEN操作符用于选取两个值范围内的值. 语法格式如下: SELECT 列名1,列名2... FROM 表名 WHERE 列名 BETWEEN 值1 AND ...
- 『Go基础』第5节 第一个Go程序
本节我们来学习写一个最简单的Go程序: 打印 Hello Go. 第一个Go程序, 只要跟着做, 留下个印象就可以. 用Goland创建一个 hello_go.go 文件(后缀为 .go ). 文件内 ...
- int and Integer
int和Integer的区别 1.Integer是int的包装类,int则是java的一种基本数据类型 2.Integer变量必须实例化后才能使用,而int变量不需要 3.Integer实际是对象的引 ...
- Mybatis @One注解使用
@One注解:一对一关联查询
- 「PKUWC2018/PKUSC2018」试题选做
「PKUWC2018/PKUSC2018」试题选做 最近还没想好报THUSC还是PKUSC,THU发我的三类约(再来一瓶)不知道要不要用,甚至不知道营还办不办,协议还有没有用.所以这些事情就暂时先不管 ...
- tomcat配置外部静态资源映射路径(windows和Linux部署)
如果你不想用ngnix配置的话,只单独使用tomcat的话可以看看这篇文章,接下来开始 使用场景 1.单机开发有时侯如果放在war下每次clean都会清理当前项目下静态文件特别折腾. 2.只有启动to ...
- Linux守护进程编写指南
Linux守护进程编写指南 守护进程(Daemon)是运行在后台的一种特殊进程.它独立于控制终端并且周期性地执行某种任务或等待处理某些发生的事件.守护进程是一种很有用的进 程.Linux的大多数服务器 ...
- 一步一步手写GIS开源项目-(2)地图平移缩放实现
系列文章目录 一步一步手写GIS开源项目-(1)500行代码实现基础GIS展示功能 一步一步手写GIS开源项目-(2)地图平移缩放实现 项目github地址:https://github.com/Hu ...