-
Notifications
You must be signed in to change notification settings - Fork 0
/
agent-metrics.yaml
executable file
·116 lines (116 loc) · 2.21 KB
/
agent-metrics.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
apiVersion: v1
kind: ServiceAccount
metadata:
name: grafana-agent
namespace: ${NAMESPACE}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: grafana-agent
rules:
- apiGroups:
- ""
resources:
- nodes
- nodes/proxy
- services
- endpoints
- pods
- events
verbs:
- get
- list
- watch
- nonResourceURLs:
- /metrics
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: grafana-agent
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: grafana-agent
subjects:
- kind: ServiceAccount
name: grafana-agent
namespace: ${NAMESPACE}
---
apiVersion: v1
kind: Service
metadata:
labels:
name: grafana-agent
name: grafana-agent
namespace: ${NAMESPACE}
spec:
clusterIP: None
ports:
- name: grafana-agent-http-metrics
port: 80
targetPort: 80
selector:
name: grafana-agent
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: grafana-agent
namespace: ${NAMESPACE}
spec:
replicas: 1
selector:
matchLabels:
name: grafana-agent
serviceName: grafana-agent
template:
metadata:
labels:
name: grafana-agent
spec:
containers:
- args:
- -config.file=/etc/agent/agent.yaml
- -enable-features=integrations-next
- -server.http.address=0.0.0.0:80
command:
- /bin/agent
env:
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: grafana/agent:v0.24.0
imagePullPolicy: IfNotPresent
name: grafana-agent
ports:
- containerPort: 80
name: http-metrics
volumeMounts:
- mountPath: /var/lib/agent
name: agent-wal
- mountPath: /etc/agent
name: grafana-agent
serviceAccount: grafana-agent
volumes:
- configMap:
name: grafana-agent
name: grafana-agent
updateStrategy:
type: RollingUpdate
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: agent-wal
namespace: ${NAMESPACE}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi