How to set up log rotation

Log storage parameters in VictoriaLogs.

Where rotation is configured

Rotation parameters are set in the resource VLSingle of the VictoriaLogs component (API group operator.victoriametrics.com).

To configure VLSingle for a specific cluster, open the Management Cluster, then go to the side menu section Administration → Custom Resources. In the operator.victoriametrics.com API group, select the VLSingle resource, then open the VLSingle object in the namespace of the desired cluster.

About migrating CR during an update, see Transitions between versions.

Basic parameters

ParameterDescriptionExample
retentionPeriodLog storage period. Can take values from 1d (one day) to 100y (one hundred years)1d
retention.maxDiskSpaceUsageBytesMaximum disk capacity. If the specified volume is exceeded, the “earliest” logs for the past period will be deleted in accordance with the set storage period in retentionPeriod10MB
storage.resources.requests.storageDisk size for storing logs. When the specified volume is filled, logs stop being written3Gi

Setting example

spec:
  retentionPeriod: 1d
  extraArgs:
    retention.maxDiskSpaceUsageBytes: 10MB
  storage:
    resources:
      requests:
        storage: 3Gi