Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/pkg/operator/testdata/test-metrics-instance.in.yaml
4095 views
1
apiVersion: monitoring.grafana.com/v1alpha1
2
kind: GrafanaAgent
3
metadata:
4
name: grafana-agent-example
5
namespace: default
6
labels:
7
app: grafana-agent-example
8
spec:
9
image: grafana/agent:latest
10
logLevel: debug
11
serviceAccountName: grafana-agent
12
storage:
13
volumeClaimTemplate:
14
spec:
15
resources:
16
requests:
17
storage: 1Gi
18
metrics:
19
instanceSelector:
20
matchLabels:
21
agent: grafana-agent-example
22
23
---
24
25
apiVersion: monitoring.grafana.com/v1alpha1
26
kind: MetricsInstance
27
metadata:
28
name: primary
29
namespace: default
30
labels:
31
agent: grafana-agent-example
32
spec:
33
remoteWrite:
34
- url: http://prometheus.default.svc.cluster.local:9090/prometheus/api/v1/write
35
36
---
37
38
#
39
# Extra resources
40
#
41
42
---
43
apiVersion: v1
44
kind: ServiceAccount
45
metadata:
46
name: grafana-agent
47
namespace: default
48
---
49
apiVersion: rbac.authorization.k8s.io/v1
50
kind: ClusterRole
51
metadata:
52
name: grafana-agent
53
rules:
54
- apiGroups:
55
- ""
56
resources:
57
- nodes
58
- nodes/proxy
59
- nodes/metrics
60
- services
61
- endpoints
62
- pods
63
verbs:
64
- get
65
- list
66
- watch
67
- nonResourceURLs:
68
- /metrics
69
- /metrics/cadvisor
70
verbs:
71
- get
72
---
73
apiVersion: rbac.authorization.k8s.io/v1
74
kind: ClusterRoleBinding
75
metadata:
76
name: grafana-agent
77
roleRef:
78
apiGroup: rbac.authorization.k8s.io
79
kind: ClusterRole
80
name: grafana-agent
81
subjects:
82
- kind: ServiceAccount
83
name: grafana-agent
84
namespace: default
85
86