Version ArtifactHub License Slack X Reddit

The VictoriaLogs single Helm chart deploys VictoriaLogs database in Kubernetes. It optionally includes log collector for automatic collection of logs from Kubernetes containers and forwarding them to the deployed VictoriaLogs database.

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:

Chart Details #

VictoriaLogs #

The chart deploys VictoriaLogs database in StatefulSet mode.

The chart provides the following configuration options:

  • Persistent volume size for storing the ingested logs. See server.persistentVolume.size config option at the minimal configuration example .
  • Data retention (how long to keep logs in the database). It can be configurated via time-based retention (with units of days, weeks, or years) or via disk space-based retention limits. See server.retentionPeriod and server.retentionDiskSpaceUsage config options in the minimal configuration example . See retention docs for details.
  • Ability to enable automatic collecting all the logs from all the containers in Kubernetes and sending them to the deployed VictoriaLogs database. See vector.enabled option at the minimal configuration example .

Minimal Configuration #

You can install the chart right away without any configuration (see how to install ), but here is the minimal configuration that is commonly customized:

      # VictoriaLogs server
server:

  # Time-based retention
  retentionPeriod: 7d

  # Or disk-based retention
  # retentionDiskSpaceUsage: 5GB

  # Storage size for the ingested logs
  persistentVolume:
    size: 20Gi

# Log collector (disabled by default, needs to be enabled).
#
# If enabled, it collects all the logs from all the containers in Kubernetes
# and sends them to the deployed VictoriaLogs database.
vector:
  enabled: true
    

The beauty of this chart is that with just vector.enabled: true, you get automatic collection all the logs across all the Kubernetes containers, enriching them with Kubernetes-specific log fields (the names for these log fields start with kubernetes. prefix) and storing them into the deployed VictoriaLogs database.

Sending logs to external VictoriaLogs databases #

This chart provides an option to run logs’ collection only and to send logs to external VictoriaLogs databases. This can be done with the following configs:

      # Disable the VictoriaLogs database
server:
  enabled: false

# Enable log collection from all the containers in Kubernetes
vector:
  enabled: true
  customConfig:

    # Configure sending the collected logs to external VictoriaLogs databases
    sinks:
      vlogs:
        type: elasticsearch
        inputs: [parser]
        mode: bulk
        api_version: v8
        compression: gzip
        healthcheck:
          enabled: false
        # Specify your external VictoriaLogs endpoints. They must end with /insert/elasticsearch
        # The collected logs are sent (replicated) to all the configured endpoints.
        endpoints:
          - "https://external-vlogs.example.com/insert/elasticsearch"
          - "https://backup-vlogs.example.com/insert/elasticsearch"
        request:
          headers:
            VL-Time-Field: timestamp
            VL-Stream-Fields: stream,kubernetes.pod_name,kubernetes.container_name,kubernetes.pod_namespace
            VL-Msg-Field: message
    

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-single chart available to installation:

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

    

Install victoria-logs-single chart #

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

  • For HTTPS repository

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

          helm show values oci://ghcr.io/victoriametrics/helm-charts/victoria-logs-single > 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 vls to avoid hitting resource name limits of 63 characters

Test the installation with command:

  • For HTTPS repository

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

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

Install chart with command:

  • For HTTPS repository

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

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

Get the pods lists by running this commands:

      kubectl get pods -A | grep 'vls'

    

Get the application by running this command:

      helm list -f vls -n NAMESPACE

    

See the history of versions of vls application with command.

      helm history vls -n NAMESPACE

    

How to uninstall #

Remove application with command.

      helm uninstall vls -n NAMESPACE

    

Documentation of Helm Chart #

Install helm-docs following the instructions on this tutorial .

Generate docs with helm-docs command.

      cd charts/victoria-logs-single

helm-docs
    

The markdown generation is entirely go template driven. The tool parses metadata from charts and generates a number of sub-templates that can be referenced in a template file (by default README.md.gotmpl). If no template file is provided, the tool has a default internal template that will generate a reasonably formatted README.

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

KeyDescription
dashboards.annotations: {}
(object)

Dashboard annotations

dashboards.enabled: false
(bool)

Create VictoriaLogs dashboards

dashboards.grafanaOperator.enabled: false
(bool)
dashboards.grafanaOperator.spec.allowCrossNamespaceImport: false
(bool)
dashboards.grafanaOperator.spec.instanceSelector.matchLabels.dashboards: grafana
(string)
dashboards.labels: {}
(object)

Dashboard labels

dashboards.namespace: ""
(string)

Override default namespace, where to create dashboards

extraObjects: []
(list)

Add extra specs dynamically to this chart

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

K8s cluster domain suffix, uses 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

podDisruptionBudget:
    enabled: false
    extraLabels: {}
(object)

See kubectl explain poddisruptionbudget.spec for more. Details are here

podDisruptionBudget.extraLabels: {}
(object)

PodDisruptionBudget extra labels

printNotes: true
(bool)

Print chart notes

server.affinity: {}
(object)

Pod affinity

server.containerWorkingDir: ""
(string)

Container workdir

server.deployment:
    spec:
        strategy:
            type: Recreate
(object)

K8s Deployment specific variables

server.emptyDir: {}
(object)
server.enabled: true
(bool)

Enable deployment of server component. Deployed as StatefulSet

server.env: []
(list)

Additional environment variables (ex.: secret tokens, flags). Details are here

server.envFrom: []
(list)

Specify alternative source for env variables

server.extraArgs:
    envflag.enable: true
    envflag.prefix: VM_
    http.shutdownDelay: 15s
    httpListenAddr: :9428
    loggerFormat: json
(object)

Extra command line arguments for container of component

server.extraContainers: []
(list)

Extra containers to run in a pod with Victoria Logs container

server.extraHostPathMounts: []
(list)

Additional hostPath mounts

server.extraLabels: {}
(object)

StatefulSet/Deployment additional labels

server.extraVolumeMounts: []
(list)

Extra Volume Mounts for the container

server.extraVolumes: []
(list)

Extra Volumes for the pod

server.fullnameOverride: ""
(string)

Overrides the full name of server component

server.image.pullPolicy: IfNotPresent
(string)

Image pull policy

server.image.registry: ""
(string)

Image registry

server.image.repository: victoriametrics/victoria-logs
(string)

Image repository

server.image.tag: ""
(string)

Image tag

server.image.variant: ""
(string)

Image tag suffix, which is appended to Chart.AppVersion if no server.image.tag is defined

server.imagePullSecrets: []
(list)

Image pull secrets

server.ingress.annotations: null
(string)

Ingress annotations

server.ingress.enabled: false
(bool)

Enable deployment of ingress for server component

server.ingress.extraLabels: {}
(object)

Ingress extra labels

server.ingress.hosts:
    - name: vlogs.local
      path:
        - /
      port: http
(list)

Array of host objects

server.ingress.ingressClassName: ""
(string)

Ingress controller class name

server.ingress.pathType: Prefix
(string)

Ingress path type

server.ingress.tls: []
(list)

Array of TLS objects

server.initContainers: []
(list)

Init containers for Victoria Logs Pod

server.lifecycle: {}
(object)

Specify pod lifecycle

server.mode: statefulSet
(string)

VictoriaLogs mode: deployment, statefulSet

server.nodeSelector: {}
(object)

Pod’s node selector. Details are here

server.persistentVolume.accessModes:
    - ReadWriteOnce
(list)

Array of access modes. Must match those of existing PV or dynamic provisioner. Details are here

server.persistentVolume.annotations: {}
(object)

Persistent volume annotations

server.persistentVolume.enabled: true
(bool)

Create/use Persistent Volume Claim for server component. Use empty dir if set to false

server.persistentVolume.existingClaim: ""
(string)

Existing Claim name. If defined, PVC must be created manually before volume will be bound

server.persistentVolume.matchLabels: {}
(object)

Bind Persistent Volume by labels. Must match all labels of targeted PV.

server.persistentVolume.mountPath: /storage
(string)

Mount path. Server data Persistent Volume mount root path.

server.persistentVolume.name: ""
(string)

Override Persistent Volume Claim name

server.persistentVolume.size: 10Gi
(string)

Size of the volume. Should be calculated based on the logs you send and retention policy you set.

server.persistentVolume.storageClassName: ""
(string)

StorageClass to use for persistent volume. Requires server.persistentVolume.enabled: true. If defined, PVC created automatically

server.persistentVolume.subPath: ""
(string)

Mount subpath

server.podAnnotations: {}
(object)

Pod’s annotations

server.podLabels: {}
(object)

Pod’s additional labels

server.podSecurityContext:
    enabled: true
    fsGroup: 2000
    runAsNonRoot: true
    runAsUser: 1000
(object)

Pod’s security context. Details are here

server.priorityClassName: ""
(string)

Name of Priority Class

server.probe.liveness:
    failureThreshold: 10
    initialDelaySeconds: 30
    periodSeconds: 30
    tcpSocket: {}
    timeoutSeconds: 5
(object)

Indicates whether the Container is running. If the liveness probe fails, the kubelet kills the Container, and the Container is subjected to its restart policy. If a Container does not provide a liveness probe, the default state is Success.

server.probe.readiness:
    failureThreshold: 3
    httpGet: {}
    initialDelaySeconds: 5
    periodSeconds: 5
    timeoutSeconds: 5
(object)

Indicates whether the Container is ready to service requests. If the readiness probe fails, the endpoints controller removes the Pod’s IP address from the endpoints of all Services that match the Pod. The default state of readiness before the initial delay is Failure. If a Container does not provide a readiness probe, the default state is Success.

server.probe.startup: {}
(object)

Indicates whether the Container is done with potentially costly initialization. If set it is executed first. If it fails Container is restarted. If it succeeds liveness and readiness probes takes over.

server.replicaCount: 1
(int)

Replica count

server.resources: {}
(object)

Resource object. Details are here

server.retentionDiskSpaceUsage: ""
(string)

Data retention max capacity. Default unit is GiB. See these docs

server.retentionPeriod: 1
(int)

Data retention period. Possible units character: h(ours), d(ays), w(eeks), y(ears), if no unit character specified - month. The minimum retention period is 24h. See these docs

server.schedulerName: ""
(string)

Use an alternate scheduler, e.g. “stork”. Check details here

server.securityContext:
    allowPrivilegeEscalation: false
    capabilities:
        drop:
            - ALL
    enabled: true
    readOnlyRootFilesystem: true
(object)

Security context to be added to server pods

server.service.annotations: {}
(object)

Service annotations

server.service.clusterIP: None
(string)

Service ClusterIP

server.service.externalIPs: []
(list)

Service external IPs. Details are here

server.service.externalTrafficPolicy: ""
(string)

Service external traffic policy. Check here for details

server.service.extraPorts: []
(list)

Extra service ports

server.service.healthCheckNodePort: ""
(string)

Health check node port for a service. Check here for details

server.service.ipFamilies: []
(list)

List of service IP families. Check here for details.

server.service.ipFamilyPolicy: ""
(string)

Service IP family policy. Check here for details.

server.service.labels: {}
(object)

Service labels

server.service.loadBalancerIP: ""
(string)

Service load balancer IP

server.service.loadBalancerSourceRanges: []
(list)

Load balancer source range

server.service.servicePort: 9428
(int)

Service port

server.service.targetPort: http
(string)

Target port

server.service.type: ClusterIP
(string)

Service type

server.serviceMonitor.annotations: {}
(object)

Service Monitor annotations

server.serviceMonitor.basicAuth: {}
(object)

Basic auth params for Service Monitor

server.serviceMonitor.enabled: false
(bool)

Enable deployment of Service Monitor for server component. This is Prometheus operator object

server.serviceMonitor.extraLabels: {}
(object)

Service Monitor labels

server.serviceMonitor.metricRelabelings: []
(list)

Service Monitor metricRelabelings

server.serviceMonitor.relabelings: []
(list)

Service Monitor relabelings

server.serviceMonitor.targetPort: http
(string)

Service Monitor target port

server.statefulSet:
    spec:
        podManagementPolicy: OrderedReady
        updateStrategy: {}
(object)

K8s StatefulSet specific variables

server.statefulSet.spec.podManagementPolicy: OrderedReady
(string)

Deploy order policy for StatefulSet pods

server.statefulSet.spec.updateStrategy: {}
(object)

StatefulSet update strategy. Check here for details.

server.terminationGracePeriodSeconds: 60
(int)

Pod’s termination grace period in seconds

server.tolerations: []
(list)

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

server.topologySpreadConstraints: []
(list)

Pod topologySpreadConstraints

server.vmServiceScrape.annotations: {}
(object)
server.vmServiceScrape.enabled: false
(bool)

Enable deployment of VMServiceScrape for server component. This is Victoria Metrics operator object

server.vmServiceScrape.extraLabels: {}
(object)
server.vmServiceScrape.metricRelabelings: []
(list)
server.vmServiceScrape.relabelings: []
(list)

Commented. TLS configuration to use when scraping the endpoint tlsConfig: insecureSkipVerify: true

server.vmServiceScrape.targetPort: http
(string)

target port

serviceAccount.annotations: {}
(object)

ServiceAccount annotations

serviceAccount.automountToken: true
(bool)

Mount API token to pod directly

serviceAccount.create: false
(bool)

Create service account.

serviceAccount.extraLabels: {}
(object)

ServiceAccount labels

serviceAccount.name: null
(string)

The name of the service account to use. If not set and create is true, a name is generated using the fullname template