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 ...
随机推荐
- [LeetCode] 242. Valid Anagram 验证变位词
Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input: ...
- 【VS开发】MFC动态设置对话框属性 弹出或嵌入
参考: MFC的对话框CDialog是怎么控制窗口可调整大小的属性的呢?打开资源文件,对话框资源的属性列表中,有一个"Border"项,改变该项的值就可以改变窗口边框风格.实际上w ...
- csp联考T1
本题主要难点在于如何处理dist^2的问题 40分算法 n^2暴力就不必多嘴,直接枚举根节点DFS就行了. 70分算法 对于b=0的情况,我们可以考虑用换根法来计算根节点的变化对总权值带来的影响. 换 ...
- QT 安装 配置过程
QT, QT creator的安装,环境配置: 需要根据这个连接重新梳理一遍:https://blog.csdn.net/win_turn/article/details/50465127 1)一种方 ...
- JVM的内存分配垃圾回收策略
之前看过<深入了解Java虚拟机>感觉容易忘,今天写一篇博客加深一下印象. JVM的内存分配和垃圾回收(GC)主要发生在Java堆中.而Java堆根据对象的存活时间可以分为新生代和老年代, ...
- day33——进程的创建方式、pid、空间隔离、join方法、其他属性、守护进程
day33 进程创建的两种方式 在windows环境下,开启进程必须在______name______ == "______main______"下面 p.start(): 只是向 ...
- 【flask】登陆后返回之前重定向跳转的页面
登陆后返回之前重定向跳转的页面 一.前言 实现强制跳转到登陆页面,登陆后返回之前的页面的功能.网上跳登陆页面的很多:返回之前页面功能没多少.这里我只是用了自己的方法,有缺点和其他方法也请指点!(´ε` ...
- Go语言( 函数)
函数是组织好的.可重复使用的.用于执行指定任务的代码块.本文介绍了Go语言中函数的相关内容. 函数 Go语言中支持函数.匿名函数和闭包,并且函数在Go语言中属于“一等公民”. 函数定义 Go语言中定义 ...
- shell分享
shell脚本分享 一.介绍shell Shell 是一个用 C 语言编写的程序,它是用户使用 Linux 的桥梁.Shell 既是一种命令语言,又是一种程序设计语言. Shell 是指一种应用程序, ...
- bootstrap table 列表增加输入框并保存输入的值不清除
需求: 在bootstrap table上增加输入框,需要选择的时候把输入的值保存到 row 里面,传递给其他模块使用. 实现: columns: [{ ...., { field: 'myField ...