Version ArtifactHub License Slack X Reddit

VictoriaLogs Collector - collects logs from Kubernetes containers and stores them to VictoriaLogs

Prerequisites #

Before installing this chart, ensure your environment meets the following requirements:

  • Kubernetes cluster - A running Kubernetes cluster with sufficient resources
  • Helm - Helm package manager installed and configured

Additional requirements depend on your configuration:

  • Persistent storage - Required if you enable persistent volumes for data retention (enabled by default)
  • kubectl - Needed for cluster management and troubleshooting

For installation instructions, refer to the official documentation:

How to install #

Access a Kubernetes cluster.

Setup chart repository (can be omitted for OCI repositories) #

Add a chart helm repository with follow commands:

      helm repo add vm https://victoriametrics.github.io/helm-charts/

helm repo update

    

List versions of vm/victoria-logs-collector chart available to installation:

      helm search repo vm/victoria-logs-collector -l

    

Install victoria-logs-collector chart #

Export default values of victoria-logs-collector chart to file values.yaml:

  • For HTTPS repository

          helm show values vm/victoria-logs-collector > values.yaml
    
        
  • For OCI repository

          helm show values oci://ghcr.io/victoriametrics/helm-charts/victoria-logs-collector > values.yaml
    
        

Change the values according to the need of the environment in values.yaml file.

Note

Consider setting .Values.nameOverride to a small value like vlc to avoid hitting resource name limits of 63 characters

Test the installation with command:

  • For HTTPS repository

          helm install vlc vm/victoria-logs-collector -f values.yaml -n NAMESPACE --debug
    
        
  • For OCI repository

          helm install vlc oci://ghcr.io/victoriametrics/helm-charts/victoria-logs-collector -f values.yaml -n NAMESPACE --debug
    
        

Install chart with command:

  • For HTTPS repository

          helm install vlc vm/victoria-logs-collector -f values.yaml -n NAMESPACE
    
        
  • For OCI repository

          helm install vlc oci://ghcr.io/victoriametrics/helm-charts/victoria-logs-collector -f values.yaml -n NAMESPACE
    
        

Get the pods lists by running this commands:

      kubectl get pods -A | grep 'vlc'

    

Get the application by running this command:

      helm list -f vlc -n NAMESPACE

    

See the history of versions of vlc application with command.

      helm history vlc -n NAMESPACE

    

Chart Details #

This Helm chart deploys a log collection agent as a DaemonSet. It collects logs from all containers in a Kubernetes cluster and forwards them to the configured VictoriaLogs destinations. If more than one destination is specified, then the collected logs are replicated among the configured destinations.

This chart will expand its functionality as the corresponding features are added to vlagent .

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

Example of a minimal working configuration:

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

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

If multiple remoteWrite entries are defined, logs will be replicated to all 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:

      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 , use projectID and accountID as shown below:

      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 collector 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).

      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.

      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:

      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 .

Extra fields #

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

      remoteWrite:
  - url: http://victoria-logs:9428/
    extraFields:
      zone: us-east1-c
      source: victoria-logs-collector
    

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

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-collector/values.yaml file.

KeyDescription
affinity: {}
(object)

Pod affinity

annotations: {}
(object)

Annotations to be added to the deployment

env: []
(list)

Environment variables (ex.: secret tokens).

extraVolumeMounts: []
(list)

Extra Volume Mounts for the container

extraVolumes: []
(list)

Extra Volumes for the pod

fullnameOverride: ""
(string)

Override resources fullname

global.cluster.dnsDomain: cluster.local.
(string)

K8s cluster domain suffix, used for building storage pods’ FQDN. Details are here

global.compatibility:
    openshift:
        adaptSecurityContext: auto
(object)

Openshift security context compatibility configuration

global.image.registry: ""
(string)

Image registry, that can be shared across multiple helm charts

global.imagePullSecrets: []
(list)

Image pull secrets, that can be shared across multiple helm charts

nameOverride: ""
(string)

Override chart name

nodeSelector: {}
(object)

Pod’s node selector. Details are here

podAnnotations: {}
(object)

Annotations to be added to pod

podLabels: {}
(object)

Extra labels for Pods only

podSecurityContext:
    enabled: true
(object)

Security context to be added to pod

priorityClassName: ""
(string)

Priority class to be assigned to the pod(s)

remoteWrite: null
(string)

List of log destinations. Logs will be replicated to all listed destinations. If using a proxy (e.g., vmauth, nginx) in front of VictoriaLogs, make sure /insert/jsonline and /internal/insert endpoints are properly routed.

resources: null
(string)
securityContext:
    enabled: true
(object)

Security context to be added to pod’s containers

serviceAccount:
    annotations: {}
    automount: true
    name: ""
(object)

Service account is needed to enrich logs with pod metadata using Kubernetes API

tolerations: []
(list)

Node tolerations for server scheduling to nodes with taints. Details are here

topologySpreadConstraints: null
(string)

Pod topologySpreadConstraints