This feature is actively developed. It might significantly change in the future.

The module is not enabled by default in any bundles.

How to explicitly enable the module…

Note that the configOverrides parameter of the InitConfiguration resource is used when installing Deckhouse, not ModuleConfig.

Set the lokiEnabled: true or lokiEnabled: false in the configOverrides parameter to explicitly enable or disable the module when installing Deckhouse.

Use the loki section of the configOverrides parameter to configure the module when installing Deckhouse.

Set the spec.enabled module parameter to true or false to explicitly enable or disable the module.

Example of enabling the loki module:

apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
  name: loki
spec:
  enabled: true

Example of disabling the loki module:

apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
  name: loki
spec:
  enabled: false

The module is configured using the ModuleConfig custom resource named loki (learn more about setting up Deckhouse…).

Example of the ModuleConfig/loki resource for configuring the module:

apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
  name: loki
spec:
  version: 1
  enabled: true
  settings: # <-- Module parameters from the "Parameters" section below.

Parameters

Schema version: 1

  • diskSizeGigabytesinteger

    Disk size for log storage or PVC size when specifying the storageClass parameters. You should manually specify the required disk size for storing logs for the period defined by the retentionPeriodHours parameter. Loki cannot automatically delete old data when the disk is full. The extended-monitoring module automatically monitors the percentage of used disk space. CAUTION! If the Loki data disk becomes full, the application will stop working. You must find the right balance between retentionPeriodHours and diskSizeGigabytes values.

    Default: 2

  • nodeSelectorobject

    The same as the Pods’ spec.nodeSelector parameter in Kubernetes. If the parameter is omitted or false, nodeSelector will be determined automatically.

  • resourcesManagement

    Loki resources management options.

    Examples:

    resourcesManagement:
      mode: VPA
      vpa:
        mode: Auto
        cpu:
          min: 50m
          max: 2
          limitRatio: 1.5
        memory:
          min: 256Mi
          max: 2Gi
          limitRatio: 1.5
    
    resourcesManagement:
      mode: Static
      static:
        requests:
          cpu: 55m
          memory: 256Mi
        limits:
          cpu: 2
          memory: 2Gi
    
    • resourcesManagement.modestring

      The mode for managing resource requests. Classical Static requests/limit or VPA.

      Default: "VPA"

      Allowed values: VPA, Static

    • resourcesManagement.staticobject

      Static resource management settings.

      • resourcesManagement.static.limitsobject

        Limits configuration.

        • resourcesManagement.static.limits.cpu

          CPU limits.

        • resourcesManagement.static.limits.memory

          Memory limits.

      • resourcesManagement.static.requestsobject

        Requests configuration.

        • resourcesManagement.static.requests.cpu

          CPU requests.

        • resourcesManagement.static.requests.memory

          Memory requests.

    • resourcesManagement.vpaobject

      Parameters of the VPA mode.

      • resourcesManagement.vpa.cpuobject

        CPU-related parameters.

        • resourcesManagement.vpa.cpu.limitRationumber

          The coefficient to calculate cpu limits. It is optionally used to calculate initial limits for Pod. VPA for its part keeps the initial limits/requests ratio during further resource tunings.

        • resourcesManagement.vpa.cpu.max

          Maximum allowed CPU requests.

          Default: 2

        • resourcesManagement.vpa.cpu.min

          Minimum allowed CPU requests.

          Default: 50m

      • resourcesManagement.vpa.memoryobject

        The amount of memory requested.

        • resourcesManagement.vpa.memory.limitRationumber

          The coefficient to calculate memory limits. It is optionally used to calculate initial limits for Pod. VPA for its part keeps the initial limits/requests ratio during further resource tunings.

        • resourcesManagement.vpa.memory.max

          Maximum allowed memory requests.

          Default: 2Gi

        • resourcesManagement.vpa.memory.min

          Minimum allowed memory requests.

          Default: 256Mi

      • resourcesManagement.vpa.modestring

        The VPA usage mode.

        Default: "Auto"

        Allowed values: Initial, Auto

  • retentionPeriodHoursinteger

    How many hours to keep logs before deleting.

    Default: 168

  • storageClass

    The name of the StorageClass to use. If omitted, the StorageClass of the existing Loki PVC is used. If there is no PVC yet, either the global StorageClass or global.discovery.defaultStorageClass is used, and if those are undefined, the emptyDir volume is used to store the data. storageClass: false — forces the emptyDir usage. You will need to delete the old PVC and restart the Pod manually. CAUTION! Setting a value other than the current one (in the existing PVC) will cause the Loki volume to be re-provisioned and the data to be lost.

    Examples:

    storageClass: false
    
    storageClass: default
    
  • storeSystemLogsboolean

    Save logs from the d8-* namespaces to loki.

    The log-shipper module must be enabled.

    Default: true

  • tolerationsarray of objects

    The same as the Pods’ spec.tolerations parameter in Kubernetes. If the parameter is omitted or false, tolerations will be determined automatically.

    • tolerations.effectstring
    • tolerations.keystring
    • tolerations.operatorstring
    • tolerations.tolerationSecondsinteger
    • tolerations.valuestring

An example of the configuration

apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
  name: loki
spec:
  settings:
    storageClass: ceph-csi-rbd
    diskSizeGigabytes: 10
    retentionPeriodHours: 48
  enabled: true
  version: 1