-
Notifications
You must be signed in to change notification settings - Fork 485
/
_agent.yaml
79 lines (79 loc) · 2.41 KB
/
_agent.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
{{- define "grafana-agent.container" -}}
- name: grafana-agent
image: {{ .Values.image.repository }}:{{ include "grafana-agent.imageTag" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
{{- if eq .Values.agent.mode "flow"}}
- run
- /etc/agent/{{ include "grafana-agent.config-map.key" . }}
- --storage.path={{ .Values.agent.storagePath }}
- --server.http.listen-addr={{ .Values.agent.listenAddr }}:{{ .Values.agent.listenPort }}
{{- if not .Values.agent.enableReporting }}
- --disable-reporting
{{- end}}
{{- end}}
{{- if eq .Values.agent.mode "static"}}
- -config.file=/etc/agent/{{ include "grafana-agent.config-map.key" . }}
- -server.http.address={{ .Values.agent.listenAddr }}:{{ .Values.agent.listenPort }}
{{- end}}
{{- range .Values.agent.extraArgs }}
- {{ . }}
{{- end}}
env:
- name: AGENT_MODE
value: {{ .Values.agent.mode }}
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
{{- range .Values.agent.extraEnv }}
- {{- toYaml . | nindent 6 }}
{{- end }}
{{- if .Values.agent.envFrom }}
envFrom:
{{- toYaml .Values.agent.envFrom | nindent 4 }}
{{- end }}
ports:
- containerPort: {{ .Values.agent.listenPort }}
name: http-metrics
- containerPort: {{ .Values.agent.faroPort }}
name: faro
{{- range $portMap := .Values.agent.extraPorts }}
- containerPort: {{ $portMap.targetPort }}
{{- if $portMap.hostPort }}
hostPort: {{ $portMap.hostPort }}
{{- end}}
name: {{ $portMap.name }}
protocol: {{ coalesce $portMap.protocol "TCP" }}
{{- end }}
readinessProbe:
httpGet:
path: /-/ready
port: {{ .Values.agent.listenPort }}
initialDelaySeconds: 10
timeoutSeconds: 1
{{- with .Values.agent.resources }}
resources:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.agent.securityContext }}
securityContext:
{{- toYaml . | nindent 4 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /etc/agent
{{- if .Values.agent.mounts.varlog }}
- name: varlog
mountPath: /var/log
readOnly: true
{{- end }}
{{- if .Values.agent.mounts.dockercontainers }}
- name: dockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
{{- end }}
{{- range .Values.agent.mounts.extra }}
- {{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}