The module is not enabled by default in any bundles.
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
- diskSizeGigabytes
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 betweenretentionPeriodHours
anddiskSizeGigabytes
values.Default:
2
- lokiConfig
Loki configuration options available for tuning.
See Loki documentation for more information.
Caution! Incorrect settings may lead to the malfunction of Loki.
- lokiConfig.grpcServerMaxConcurrentStreams
Limit on the number of concurrent streams for gRPC calls.
Default:
100
- lokiConfig.grpcServerMaxRecvMsgSize
Limit on the size of a gRPC message this server can receive in bytes.
Default:
104857600
- lokiConfig.grpcServerMaxSendMsgSize
Limit on the size of a gRPC message this server can send in bytes.
Default:
4194304
- lokiConfig.ingestionBurstSizeMB
Overall ingestion burst size in megabytes. E.g., maximum push request size.
Default:
6
- lokiConfig.ingestionRateMB
Overall ingestion rate limit in megabytes per second.
Default:
4
- lokiConfig.maxChunksPerQuery
The maximum number of chunks that can be fetched per query.
Default:
2000000
- lokiConfig.maxEntriesLimitPerQuery
The maximum number of entries returned for the query.
Default:
5000
- lokiConfig.maxStreamsPerUser
The maximum total number of streams for the Loki instance.
Each stream has unique labels. The number of streams is the number of unique label sets. E. g.
{job="my-app", instance="kube-node-1", namespace="production", pod_name="backend-79dbf6fcb7-v5gs7", app="backend"}
.0 means unlimited.
Default:
0
- lokiConfig.perStreamRateLimit
Maximum byte rate per second per stream. Can be either a number or a string with a unit (KB, MB, GB).
Default:
3MB
- lokiConfig.perStreamRateLimitBurst
Maximum burst size per stream. Can be either a number or a string with a unit (KB, MB, GB).
Default:
15MB
- nodeSelector
The same as the Pods’
spec.nodeSelector
parameter in Kubernetes. If the parameter is omitted orfalse
,nodeSelector
will be determined automatically. - resourcesManagement
Settings for CPU and memory requests and limits by Loki pods.
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.mode
Resource management mode:
Default:
"VPA"
Allowed values:
VPA
,Static
- resourcesManagement.static
Resource management options for the
Static
mode.- resourcesManagement.static.limits
Configuring CPU and memory limits.
- resourcesManagement.static.limits.cpu
Configuring CPU limits.
- resourcesManagement.static.limits.memory
Configuring memory limits.
- resourcesManagement.static.requests
Resource requests settings for pods.
- resourcesManagement.static.requests.cpu
Configuring CPU requests.
- resourcesManagement.static.requests.memory
Configuring memory requests.
- resourcesManagement.vpa
Resource management options for the
VPA
mode.- resourcesManagement.vpa.cpu
CPU-related VPA settings.
- resourcesManagement.vpa.cpu.limitRatio
The CPU limits/requests ratio.
This ratio is used for calculating the initial CPU limits for a pod.
If this parameter is set, the VPA will recalculate the CPU limits while maintaining the specified limits/requests ratio.
- resourcesManagement.vpa.cpu.max
The maximum value that the VPA can set for the CPU requests.
Default:
2
- resourcesManagement.vpa.cpu.min
The minimum value that the VPA can set for the CPU requests.
Default:
50m
- resourcesManagement.vpa.memory
Memory-related VPA settings.
- resourcesManagement.vpa.memory.limitRatio
The memory limits/requests ratio.
This ratio is used for calculating the initial memory limits for a pod.
If this parameter is set, the VPA will recalculate the memory limits while maintaining the specified limits/requests ratio.
- resourcesManagement.vpa.memory.max
The maximum memory requests the VPA can set.
Default:
2Gi
- resourcesManagement.vpa.memory.min
The minimum memory requests the VPA can set.
Default:
256Mi
- resourcesManagement.vpa.mode
VPA operating mode.
Default:
"Auto"
Allowed values:
Initial
,Auto
- retentionPeriodHours
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 theemptyDir
usage. You will need to delete the old PVC and restart the Pod manually.global.discovery.defaultStorageClass
is applied during module activation, changing default StorageClass in cluster won’t result in disk re-provisioning.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
- storeSystemLogs
Save logs from the
d8-*
namespaces to loki.The log-shipper module must be enabled.
Default:
true
- tolerations
The same as the Pods’
spec.tolerations
parameter in Kubernetes. If the parameter is omitted orfalse
,tolerations
will be determined automatically.- tolerations.effect
- tolerations.key
- tolerations.operator
- tolerations.tolerationSeconds
- tolerations.value
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