-
Notifications
You must be signed in to change notification settings - Fork 67
/
fuse-servicemonitor.yml
90 lines (86 loc) · 2.24 KB
/
fuse-servicemonitor.yml
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
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: fuse-prometheus-service-monitor
labels:
app: fuse-prometheus-service-monitor
annotations:
openshift.io/display-name: "Red Hat Fuse service-monitor install"
openshift.io/provider-display-name: "Red Hat, Inc."
description: "A ServiceMonitor specifies how groups of services should be monitored - this template defines how to monitor a Fuse application for Prometheus."
tags: "fuse,prometheus,prometheus-operator,monitoring"
iconClass: "icon-rh-integration"
version: "1.0"
message: |-
service-monitor is now deployed to ${NAMESPACE}
parameters:
- name: NAMESPACE
displayName: Namespace
value: fuse
required: true
description: Namespace in which the prometheus-operator is installed.
- name: FUSE_SERVICE_NAME
displayName: Fuse Service Name
value: 'myservicename'
required: true
description: The service name of the Fuse application to monitor.
- name: FUSE_SERVICE_TEAM
displayName: Fuse Service Team
value: 'fuse'
required: true
- name: ENDPOINT_PORT
displayName: Endpoint port
value: 'web'
required: true
objects:
#
# OpenShift resources
#
- apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: ${FUSE_SERVICE_NAME}
namespace: ${NAMESPACE}
labels:
team: ${FUSE_SERVICE_TEAM}
spec:
selector:
matchLabels:
app: ${FUSE_SERVICE_NAME}
endpoints:
- port: ${ENDPOINT_PORT}
labels:
app.kubernetes.io/instance: fuse
- apiVersion: v1
kind: Service
metadata:
name: ${FUSE_SERVICE_NAME}
namespace: ${NAMESPACE}
labels:
app: ${FUSE_SERVICE_NAME}
spec:
selector:
app: ${FUSE_SERVICE_NAME}
ports:
- name: ${ENDPOINT_PORT}
port: 9779
- apiVersion: v1
kind: ServiceAccount
metadata:
name: grafana-serviceaccount
labels:
app: ${FUSE_SERVICE_NAME}
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: grafana-cluster-monitoring-binding
labels:
app: ${FUSE_SERVICE_NAME}
subjects:
- kind: ServiceAccount
name: grafana-serviceaccount
namespace: ${NAMESPACE}
roleRef:
kind: ClusterRole
name: cluster-monitoring-view
apiGroup: rbac.authorization.k8s.io