forked from grpc/test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-prometheus.yaml
119 lines (119 loc) · 2.47 KB
/
install-prometheus.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
---
# From https://github.com/istio/tools/blob/1.13.2/perf/istio-install/base/templates/prometheus-install.yaml
# with namespace replaced and configuration related to Istio left out.
apiVersion: v1
kind: ServiceAccount
metadata:
name: prometheus
namespace: test-infra-system
labels:
app: prometheus
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: ssd
parameters:
type: pd-ssd
provisioner: kubernetes.io/gce-pd
reclaimPolicy: Delete
volumeBindingMode: Immediate
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: prometheus-prometheus
labels:
app: prometheus
rules:
- apiGroups: [""]
resources:
- nodes
- services
- endpoints
- pods
- nodes/proxy
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources:
- configmaps
verbs: ["get"]
- nonResourceURLs: ["/metrics"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: prometheus-prometheus
labels:
app: prometheus
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: prometheus-prometheus
subjects:
- kind: ServiceAccount
name: prometheus
namespace: test-infra-system
---
apiVersion: v1
kind: Service
metadata:
name: prometheus
namespace: test-infra-system
annotations:
prometheus.io/scrape: "true"
labels:
app: prometheus
spec:
selector:
app: prometheus
ports:
- name: http-prometheus
protocol: TCP
port: 9090
---
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
name: prometheus
namespace: test-infra-system
spec:
alerting:
alertmanagers:
- name: alertmanager-main
namespace: test-infra-system
port: web
ruleSelector:
matchLabels:
role: prometheus-example-rules
prometheus: prometheus
image: quay.io/prometheus/prometheus:v2.32.1
version: v2.32.1
retention: 72h
scrapeInterval: 1s
serviceAccountName: prometheus
enableAdminAPI: false
serviceMonitorNamespaceSelector: {}
serviceMonitorSelector: {}
podMonitorNamespaceSelector: {}
podMonitorSelector: {}
nodeSelector:
pool: system
podMetadata:
labels:
app: prometheus
securityContext:
fsGroup: 2000
runAsNonRoot: true
runAsUser: 1000
storage:
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
# required field
storage: 20Gi
storageClassName: ssd