Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions charts/victoria-logs-agent/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
*.md.gotmpl
CHANGELOG.md
_changelog.md
_index.md
e2e/
lint/
tests/
3 changes: 3 additions & 0 deletions charts/victoria-logs-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Next release

- charts/victoria-logs-agent: add new chart
6 changes: 6 additions & 0 deletions charts/victoria-logs-agent/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: victoria-metrics-common
repository: https://victoriametrics.github.io/helm-charts
version: 0.0.42
digest: sha256:dfa78bd40154cb14f4638f4e8b130730a2d05c0d22cf38a220af070fefcd391e
generated: "2025-07-11T12:36:42.838849+04:00"
32 changes: 32 additions & 0 deletions charts/victoria-logs-agent/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: v2
type: application
appVersion: v1.36.1
name: victoria-logs-agent
description: VictoriaLogs Agent - accepts logs from various protocols and replicates them across multiple VictoriaLogs instances.
version: 0.0.1
sources:
- https://github.com/VictoriaMetrics/helm-charts
icon: https://avatars.githubusercontent.com/u/43720803?s=200&v=4
kubeVersion: ">=1.25.0-0"
home: https://github.com/VictoriaMetrics/helm-charts
keywords:
- victorialogs
- logs
- agent
- collector
- kubernetes
- observability
annotations:
artifacthub.io/license: Apache-2.0
artifacthub.io/category: "monitoring-logging"
artifacthub.io/links: |
- name: Sources
url: https://github.com/VictoriaMetrics/helm-charts/tree/master/charts/victoria-logs-agent
- name: Charts repo
url: https://victoriametrics.github.io/helm-charts/
- name: Changelog
url: https://docs.victoriametrics.com/changelog/
dependencies:
- name: victoria-metrics-common
version: "0.0.*"
repository: https://victoriametrics.github.io/helm-charts
3 changes: 3 additions & 0 deletions charts/victoria-logs-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# VictoriaLogs Agent Helm chart

Chart documentation is available [here](https://docs.victoriametrics.com/helm/victoria-logs-agent/)
14 changes: 14 additions & 0 deletions charts/victoria-logs-agent/_changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
title: CHANGELOG
menu:
docs:
weight: 1
identifier: helm-victorialogs-agent-changelog
parent: helm-victorialogs-agent
url: /helm/victorialogs-agent/changelog
aliases:
- /helm/victorialogs-agent/changelog/index.html
tags:
- logs
- kubernetes
---
{{% content "CHANGELOG.md" %}}
173 changes: 173 additions & 0 deletions charts/victoria-logs-agent/_index.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
---
weight: 2
title: VictoriaLogs Agent
menu:
docs:
parent: helm
weight: 2
identifier: helm-victorialogs-agent
url: /helm/victoria-logs-agent
aliases:
- /helm/victorialogs-agent/index.html
- /helm/victorialogs-agent/
tags:
- logs
- kubernetes
---
{{ template "chart.badges" . }}

{{ template "chart.description" . }}

{{ template "chart.prerequisites" . }}
## Quick start

This Helm chart deploys the log receiver agent as a StatefulSet or Deployment (configurable via values in the chart).
It receives logs using [supported protocols](https://docs.victoriametrics.com/victorialogs/data-ingestion/)
(for example: syslog, Elasticsearch, OpenTelemetry) from cluster workloads and forwards them to the configured VictoriaLogs destinations.
If more than one destination is specified, collected logs are replicated to all configured destinations.

- To quickly install single-node version of VictoriaLogs and `victoria-logs-agent`, see [these docs](https://docs.victoriametrics.com/helm/victoria-logs-single/#quick-start).
- To start with a VictoriaLogs cluster and `victoria-logs-agent`, see [these docs](https://docs.victoriametrics.com/helm/victoria-logs-cluster/#quick-start).

## Chart configuration

The simplest working configuration includes specifying the `remoteWrite` array and setting CPU and memory resources for the chart.

Example of a minimal working configuration:

```yaml
remoteWrite:
- url: http://victoria-logs:9428

resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
```

If multiple `remoteWrite` entries are defined, logs are replicated to all the specified destinations.

### Basic auth

If you need to use basic auth, define the secrets via environment variables and fill out the `basicAuth` object as shown below:

```yaml
remoteWrite:
- url: http://victoria-logs:9428
basicAuth:
passwordEnvKey: 'VL_PASSWORD'
usernameEnvKey: 'VL_USERNAME'

env:
- name: VL_PASSWORD
valueFrom:
secretKeyRef:
name: auth-secret
key: VL_PASSWORD
- name: VL_USERNAME
valueFrom:
secretKeyRef:
name: auth-secret
key: VL_USERNAME
```

### Multitenancy

To define [tenant](https://docs.victoriametrics.com/victorialogs/#multitenancy), use `projectID` and `accountID` as shown below:

```yaml
remoteWrite:
- url: http://localhost:9428
projectID: 12
accountID: 42
```

### TLS

To enable TLS verification for the remoteWrite target, you can specify the `tls` block inside each remoteWrite entry.

At a minimum, you should provide the `caFile` path so that the agent can verify the server's TLS certificate.
This is useful when the target endpoint uses a certificate signed by a custom or self-signed Certificate Authority (CA).

```yaml
remoteWrite:
- url: https://victoria-logs:9428
tls:
caFile: "/etc/tls/ca.crt"

extraVolumes:
- name: tls-certs
secret:
secretName: tls-secret

extraVolumeMounts:
- name: tls-certs
mountPath: /etc/tls
readOnly: true
```

If you want to disable TLS certificate verification (not recommended in production), you can set `insecureSkipVerify` to true.

This will skip verification of the server's certificate and allow connecting to targets with self-signed or invalid certificates.

```yaml
remoteWrite:
- url: https://victoria-logs:9428
tls:
insecureSkipVerify: true
```

### Ignore fields

VictoriaLogs efficiently compresses repeated values, such as pod and node labels.
However, if you prefer not to store certain fields, you can ignore them using the `ignoreFields` option.
For example:

```yaml
remoteWrite:
- url: http://victoria-logs:9428
ignoreFields:
- file
- kubernetes.container_id
- kubernetes.pod_annotations*
- kubernetes.node_labels*
- kubernetes.namespace_labels*
- kubernetes.pod_labels*
```

This allows you to exclude unnecessary or sensitive fields from being ingested.
If sensitive data has already been ingested, see how to
[exclude logs from search result](https://docs.victoriametrics.com/victorialogs/security-and-lb/#access-control-inside-a-single-tenant).

### Extra fields

You can add custom fields to your logs by including the `extraFields` section in your configuration.
For example:

```yaml
remoteWrite:
- url: http://victoria-logs:9428/
extraFields:
zone: us-east1-c
source: victoria-logs-agent
```

This feature lets you attach metadata to every log entry,
making it easier to filter, group, or analyze logs based on these additional attributes.

{{ include "chart.installSection" . }}

{{ include "chart.uninstallSection" . }}

{{ include "chart.helmDocs" . }}

## Parameters

The following tables lists the configurable parameters of the chart and their default values.

Change the values according to the need of the environment in ``victoria-logs-agent/values.yaml`` file.

{{ template "chart.valuesTableHtml" . }}
4 changes: 4 additions & 0 deletions charts/victoria-logs-agent/e2e/simple.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mode: deployment

remoteWrite:
- url: "http://victorialogs:9429"
2 changes: 2 additions & 0 deletions charts/victoria-logs-agent/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
To view running VictoriaLogs agents:
kubectl get po -o wide -l app.kubernetes.io/name={{ include "victoria-logs-agent.fullname" . }} -n {{ .Release.Namespace }}
63 changes: 63 additions & 0 deletions charts/victoria-logs-agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{- define "victoria-logs-agent.fullname" }}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- printf "%s" $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{- define "vlagent.args" -}}
{{- $args := default dict -}}
{{- $_ := set $args "remoteWrite.maxDiskUsagePerURL" .Values.maxDiskUsagePerURL -}}
{{- $_ := set $args "remoteWrite.tmpDataPath" "/vlagent-remotewrite-data" -}}
{{- $args = mergeOverwrite $args (fromYaml (include "vm.license.flag" .)) -}}
{{- toYaml (fromYaml (include "vm.args" $args)).args -}}
{{- end -}}

{{- define "vlagent.remoteWriteArgs" -}}
{{- if empty .Values.remoteWrite }}
{{- fail "'remoteWrite' list is empty; at least one remoteWrite configuration must be provided" }}
{{- end }}
{{- $args := list }}
{{- $knownFields := list "url" "basicAuth" "accountID" "projectID" "tls" "extraFields" "ignoreFields" "msgField" "streamFields" }}
{{- range $i, $rw := .Values.remoteWrite }}
{{- /* Validate remoteWrite object */ -}}
{{- if empty $rw.url }}
{{ fail (printf "'url' field must be set for remoteWrite[%d]" $i) }}
{{- end }}
{{- range $rwKey, $_ := $rw }}
{{- if not (has $rwKey $knownFields) }}
{{- fail (printf "unknown field %q for remoteWrite[%d]" $rwKey $i) }}
{{- end }}
{{- end }}

{{- $args = append $args (printf "--remoteWrite.url=%s/internal/insert" (trimSuffix "/" $rw.url)) }}

{{- $headers := list }}
{{- $headers = append $headers (printf "AccountID:%v" ($rw.accountID | default "0")) }}
{{- $headers = append $headers (printf "ProjectID:%v" ($rw.projectID | default "0")) }}
{{- if not (empty $rw.streamFields) }}
{{- $headers = append $headers (printf "VL-Stream-Fields:%s" (join "," $rw.streamFields)) }}
{{- end }}
{{- if not (empty $rw.msgField) }}
{{- $headers = append $headers (printf "VL-Msg-Field:%s" (join "," $rw.msgField)) }}
{{- end }}
{{- if not (empty $rw.timeField) }}
{{- $headers = append $headers (printf "VL-Time-Field:%s" (join "," $rw.timeField)) }}
{{- end }}
{{- if not (empty $rw.ignoreFields) }}
{{- $headers = append $headers (printf "VL-Ignore-Fields:%s" (join "," $rw.ignoreFields)) }}
{{- end }}

{{- with $rw.extraFields }}
{{- $pairs := list }}
{{- range $k, $v := . }}
{{- $pairs = append $pairs (printf "%s=%s" $k $v) }}
{{- end }}
{{- $headers = append $headers (printf "VL-Extra-Fields:%s" ($pairs | join ",")) }}
{{- end }}
{{- $args = append $args (printf "--remoteWrite.headers=%q" ($headers | join "^^")) }}
{{- end }}
{{- toYaml $args -}}
{{- end -}}
36 changes: 36 additions & 0 deletions charts/victoria-logs-agent/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{/*
Create PersistentVolumeClaim if enabled and not using existing claim in Deployment mode.
*/}}
{{- $pvc := .Values.persistentVolume }}
{{- if and $pvc.enabled (not $pvc.existingClaim) (eq .Values.mode "deployment") }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "victoria-logs-agent.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "victoria-logs-agent.fullname" . }}
{{- with $pvc.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $pvc.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with $pvc.accessModes }}
accessModes:
{{- toYaml . | nindent 4 }}
{{- end }}
resources:
requests:
storage: {{ $pvc.size }}
{{- with $pvc.storageClassName }}
storageClassName: {{ . }}
{{- end }}
{{- with $pvc.matchLabels }}
selector:
matchLabels:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
Loading
Loading