Version: 0.8.1 Artifact Hub Slack

Victoria Logs Single version - high-performance, cost-effective and scalable logs storage

Prerequisites #

  • Install the follow packages: git, kubectl, helm, helm-docs. See this tutorial.

  • PV support on underlying infrastructure.

Chart Details #

This chart will do the following:

  • Rollout Victoria Logs Single.
  • (optional) Rollout vector to collect logs from pods.

Chart allows to configure logs collection from Kubernetes pods to VictoriaLogs. In order to do that you need to enable vector:

vector:
  enabled: true

By default, vector will forward logs to VictoriaLogs installation deployed by this chart.

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.

Test the installation with command:

  • For HTTPS repository

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

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

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.

KeyTypeDefaultDescription
dashboards.annotationsobject
{}

Dashboard annotations

dashboards.enabledbool
false

Create VictoriaLogs dashboards

dashboards.grafanaOperator.enabledbool
false

dashboards.grafanaOperator.spec.allowCrossNamespaceImportbool
false

dashboards.grafanaOperator.spec.instanceSelector.matchLabels.dashboardsstring
grafana

dashboards.labelsobject
{}

Dashboard labels

extraObjectslist
[]

Add extra specs dynamically to this chart

global.cluster.dnsDomainstring
cluster.local.

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

global.compatibilityobject
openshift:
    adaptSecurityContext: auto

Openshift security context compatibility configuration

global.image.registrystring
""

Image registry, that can be shared across multiple helm charts

global.imagePullSecretslist
[]

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

global.nameOverridestring
""

Global name override

podDisruptionBudgetobject
enabled: false
extraLabels: {}

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

podDisruptionBudget.extraLabelsobject
{}

PodDisruptionBudget extra labels

printNotesbool
true

Print chart notes

server.affinityobject
{}

Pod affinity

server.containerWorkingDirstring
""

Container workdir

server.emptyDirobject
{}

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

server.enabledbool
true

Enable deployment of server component. Deployed as StatefulSet

server.envlist
[]

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

server.envFromlist
[]

Specify alternative source for env variables

server.extraArgsobject
envflag.enable: "true"
envflag.prefix: VM_
loggerFormat: json

Extra command line arguments for container of component

server.extraContainerslist
[]

Extra containers to run in a pod with Victoria Logs container

server.extraHostPathMountslist
[]

Additional hostPath mounts

server.extraLabelsobject
{}

StatefulSet/Deployment additional labels

server.extraVolumeMountslist
[]

Extra Volume Mounts for the container

server.extraVolumeslist
[]

Extra Volumes for the pod

server.image.pullPolicystring
IfNotPresent

Image pull policy

server.image.registrystring
""

Image registry

server.image.repositorystring
victoriametrics/victoria-logs

Image repository

server.image.tagstring
""

Image tag

server.image.variantstring
victorialogs

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

server.imagePullSecretslist
[]

Image pull secrets

server.ingress.annotationsstring
null

Ingress annotations

server.ingress.enabledbool
false

Enable deployment of ingress for server component

server.ingress.extraLabelsobject
{}

Ingress extra labels

server.ingress.hostslist
[]

Array of host objects

server.ingress.ingressClassNamestring
""

Ingress controller class name

server.ingress.pathTypestring
Prefix

Ingress path type

server.ingress.tlslist
[]

Array of TLS objects

server.initContainerslist
[]

Init containers for Victoria Logs Pod

server.nodeSelectorobject
{}

Pod’s node selector. Details are here

server.persistentVolume.accessModeslist
- ReadWriteOnce

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

server.persistentVolume.annotationsobject
{}

Persistant volume annotations

server.persistentVolume.enabledbool
false

Create/use Persistent Volume Claim for server component. Empty dir if false

server.persistentVolume.existingClaimstring
""

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

server.persistentVolume.matchLabelsobject
{}

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

server.persistentVolume.mountPathstring
/storage

Mount path. Server data Persistent Volume mount root path.

server.persistentVolume.namestring
""

Override Persistent Volume Claim name

server.persistentVolume.sizestring
3Gi

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

server.persistentVolume.storageClassNamestring
""

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

server.persistentVolume.subPathstring
""

Mount subpath

server.podAnnotationsobject
{}

Pod’s annotations

server.podLabelsobject
{}

Pod’s additional labels

server.podManagementPolicystring
OrderedReady

Pod’s management policy

server.podSecurityContextobject
enabled: true
fsGroup: 2000
runAsNonRoot: true
runAsUser: 1000

Pod’s security context. Details are here

server.priorityClassNamestring
""

Name of Priority Class

server.probe.livenessobject
failureThreshold: 10
initialDelaySeconds: 30
periodSeconds: 30
tcpSocket: {}
timeoutSeconds: 5

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.readinessobject
failureThreshold: 3
httpGet: {}
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5

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.startupobject
{}

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.replicaCountint
1

Replica count

server.resourcesobject
{}

Resource object. Details are here

server.retentionPeriodint
1

Data retention period in month

server.securityContextobject
allowPrivilegeEscalation: false
capabilities:
    drop:
        - ALL
enabled: true
readOnlyRootFilesystem: true

Security context to be added to server pods

server.service.annotationsobject
{}

Service annotations

server.service.clusterIPstring
""

Service ClusterIP

server.service.externalIPslist
[]

Service external IPs. Details are here

server.service.externalTrafficPolicystring
""

Service external traffic policy. Check here for details

server.service.healthCheckNodePortstring
""

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

server.service.ipFamilieslist
[]

List of service IP families. Check here for details.

server.service.ipFamilyPolicystring
""

Service IP family policy. Check here for details.

server.service.labelsobject
{}

Service labels

server.service.loadBalancerIPstring
""

Service load balacner IP

server.service.loadBalancerSourceRangeslist
[]

Load balancer source range

server.service.servicePortint
9428

Service port

server.service.typestring
ClusterIP

Service type

server.serviceMonitor.annotationsobject
{}

Service Monitor annotations

server.serviceMonitor.basicAuthobject
{}

Basic auth params for Service Monitor

server.serviceMonitor.enabledbool
false

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

server.serviceMonitor.extraLabelsobject
{}

Service Monitor labels

server.serviceMonitor.metricRelabelingslist
[]

Service Monitor metricRelabelings

server.serviceMonitor.relabelingslist
[]

Service Monitor relabelings

server.statefulSet.enabledbool
true

Creates statefulset instead of deployment, useful when you want to keep the cache

server.statefulSet.podManagementPolicystring
OrderedReady

Deploy order policy for StatefulSet pods

server.terminationGracePeriodSecondsint
60

Pod’s termination grace period in seconds

server.tolerationslist
[]

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

server.topologySpreadConstraintslist
[]

Pod topologySpreadConstraints

vectorobject
customConfig:
    api:
        address: 127.0.0.1:8686
        enabled: false
        playground: true
    data_dir: /vector-data-dir
    sinks:
        vlogs:
            api_version: v8
            compression: gzip
            endpoints: << include "vlogs.es.urls" . >>
            healthcheck:
                enabled: false
            inputs:
                - parser
            mode: bulk
            request:
                headers:
                    AccountID: "0"
                    ProjectID: "0"
                    VL-Msg-Field: message,msg,_msg,log.msg,log.message,log
                    VL-Stream-Fields: stream,kubernetes.pod_name,kubernetes.container_name,kubernetes.pod_namespace
                    VL-Time-Field: timestamp
            type: elasticsearch
    sources:
        k8s:
            type: kubernetes_logs
    transforms:
        parser:
            inputs:
                - k8s
            source: |
                .log = parse_json(.message) ?? .message
                del(.message)
            type: remap
dataDir: /vector-data-dir
enabled: false
env:
    - name: VECTOR_SELF_NODE_NAME
      valueFrom:
        fieldRef:
            fieldPath: spec.nodeName
existingConfigMaps:
    - vl-config
resources: {}
role: Agent
service:
    enabled: false

Values for vector helm chart

vector.enabledbool
false

Enable deployment of vector