-
Notifications
You must be signed in to change notification settings - Fork 690
/
Copy path03-prometheus-deployment.yaml
125 lines (123 loc) · 2.74 KB
/
03-prometheus-deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: prometheus
rules:
- apiGroups: [""]
resources:
- nodes
- nodes/proxy
- services
- endpoints
- pods
verbs: ["get", "list", "watch"]
- apiGroups:
- extensions
resources:
- ingresses
verbs: ["get", "list", "watch"]
- nonResourceURLs: ["/metrics"]
verbs: ["get"]
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: prometheus
namespace: contour-monitoring
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: prometheus
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: prometheus
subjects:
- kind: ServiceAccount
name: prometheus
namespace: contour-monitoring
---
apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/scrape: 'true'
name: prometheus
namespace: contour-monitoring
spec:
ports:
- protocol: TCP
name: prometheus
port: 9090
selector:
app: prometheus
component: server
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: prometheus
namespace: contour-monitoring
labels:
app: prometheus
component: server
spec:
replicas: 1
selector:
matchLabels:
app: prometheus
component: server
template:
metadata:
name: prometheus
labels:
app: prometheus
component: server
spec:
serviceAccountName: prometheus
containers:
- name: prometheus
image: prom/prometheus:v2.2.1
imagePullPolicy: Always
args:
- '--storage.tsdb.retention=24h'
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- containerPort: 9090
volumeMounts:
- name: config-volume
mountPath: /etc/prometheus
- name: config-volume-alert-rules
mountPath: /etc/prometheus-rules
- name: cert-file
mountPath: /etc/ssl/etcd.pem
- name: key-file
mountPath: /etc/ssl/etcd-key.pem
# blackbox exporter
# - name: blackbox
# image: quay.io/prometheus/blackbox-exporter:v0.11.0
# args:
# - --config.file=/config/blackbox.yml
# ports:
# - containerPort: 9115
# volumeMounts:
# - name: blackbox-config
# mountPath: /config
volumes:
- name: config-volume
configMap:
name: prometheus
- name: cert-file
hostPath:
path: /etc/kubernetes/ssl/etcd.pem
- name: key-file
hostPath:
path: /etc/kubernetes/ssl/etcd-key.pem
- name: config-volume-alert-rules
configMap:
name: prometheus-alert-rules
#black box exporter
# - name: blackbox-config
# configMap:
# name: prometheus-blackbox