-
Notifications
You must be signed in to change notification settings - Fork 37
/
service_monitor.go
46 lines (41 loc) · 997 Bytes
/
service_monitor.go
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
package istiod
import (
"github.com/awslabs/eksdemo/pkg/manifest"
"github.com/awslabs/eksdemo/pkg/resource"
"github.com/awslabs/eksdemo/pkg/template"
)
// https://github.com/istio/istio/blob/master/samples/addons/extras/prometheus-operator.yaml
func serviceMonitor() *resource.Resource {
res := &resource.Resource{
Options: &resource.CommonOptions{
Name: "istiod-service-monitor",
},
Manager: &manifest.ResourceManager{
Template: &template.TextTemplate{
Template: serviceMonitorYamlTemplate,
},
},
}
return res
}
const serviceMonitorYamlTemplate = `---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: istio-component-monitor
namespace: istio-system
labels:
monitoring: istio-components
release: istio
spec:
jobLabel: istio
targetLabels: [app]
selector:
matchExpressions:
- {key: istio, operator: In, values: [pilot]}
namespaceSelector:
any: true
endpoints:
- port: http-monitoring
interval: 15s
`