From 0a58e2334729ee4b282f5487863d348661b1d928 Mon Sep 17 00:00:00 2001 From: Prithviraj Patil <116709298+prithvipatil97@users.noreply.github.com> Date: Wed, 12 Nov 2025 01:28:25 +0530 Subject: [PATCH] Update LokiStack configuration with global limits for retention and managementState Doc Reference: https://docs.redhat.com/en/documentation/red_hat_openshift_logging/6.3/html/installing_logging/installing-logging#install-loki-operator-cli_installing-logging By default, the retention config is not mentioned in standard installation YAML because of which end users use the exact same config for deployment and then object storage get flooded with a lot of logs. This breaks ODF and impacts the applications consuming storage from ODF. It is required to add retention config in standard installation YAML in the documentation. If there is no retention, then the logs will not be remove / cleaned up from object storage until retention is configured or until lifecycle policy is configured on the object bucket. [new commit] Update LokiStack configuration with global limits for retention and managementState Doc Reference: https://docs.redhat.com/en/documentation/red_hat_openshift_logging/6.3/html/installing_logging/installing-logging#install-loki-operator-cli_installing-logging By default, the retention config is not mentioned in standard installation YAML because of which end users use the exact same config for deployment and then object storage get flooded with a lot of logs. This breaks ODF and impacts the applications consuming storage from ODF. It is required to add retention config in standard installation YAML in the documentation. If there is no retention, then the logs will not be remove / cleaned up from object storage until retention is configured or until lifecycle policy is configured on the object bucket. Here is the updated config: ~~~ apiVersion: loki.grafana.com/v1 kind: LokiStack metadata: name: logging-loki 1 namespace: openshift-logging 2 spec: managementState: Managed limits: global: 3 retention: 4 days: 20 # Set the value as per requirement. size: 1x.small 5 storage: schemas: - version: v13 effectiveDate: "--
" 6 secret: name: logging-loki-s3 7 type: s3 8 storageClassName: 9 tenants: mode: openshift-logging 10 ~~~ --- modules/installing-loki-operator-cli.adoc | 31 ++++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/modules/installing-loki-operator-cli.adoc b/modules/installing-loki-operator-cli.adoc index 00d99493b19b..fc56c3adc980 100644 --- a/modules/installing-loki-operator-cli.adoc +++ b/modules/installing-loki-operator-cli.adoc @@ -149,26 +149,33 @@ metadata: name: logging-loki # <1> namespace: openshift-logging # <2> spec: - size: 1x.small # <3> + managementState: Managed + limits: + global: # <3> + retention: # <4> + days: 20 # Set the value as per requirement + size: 1x.small # <5> storage: schemas: - version: v13 - effectiveDate: "--
" # <4> + effectiveDate: "--
" # <6> secret: - name: logging-loki-s3 # <5> - type: s3 # <6> - storageClassName: # <7> + name: logging-loki-s3 # <7> + type: s3 # <8> + storageClassName: # <9> tenants: - mode: openshift-logging # <8> + mode: openshift-logging # <10> ---- <1> Use the name `logging-loki`. <2> You must specify `openshift-logging` as the namespace. -<3> Specify the deployment size. Supported size options for production instances of Loki are `1x.extra-small`, `1x.small`, or `1x.medium`. Additionally, `1x.pico` is supported starting with {logging} 6.1. -<4> For new installations this date should be set to the equivalent of "yesterday", as this will be the date from when the schema takes effect. -<5> Specify the name of your log store secret. -<6> Specify the corresponding storage type. -<7> Specify the name of a storage class for temporary storage. For best performance, specify a storage class that allocates block storage. You can list the available storage classes for your cluster by using the `oc get storageclasses` command. -<8> The `openshift-logging` mode is the default tenancy mode where a tenant is created for log types, such as audit, infrastructure, and application. This enables access control for individual users and user groups to different log streams. +<3> Define global limits that apply to the LokiStack instance. For information about setting stream-based retention, see link:https://docs.redhat.com/en/documentation/red_hat_openshift_logging/6.3/html/configuring_logging/configuring-lokistack-storage#logging-loki-retention_configuring-the-log-store[Enabling stream-based retention with Loki]. This field does not impact the retention period for stored logs in object storage. +<4> Retention is enabled in the cluster when this block is added to the CR. +<5> Specify the deployment size. Supported size options for production instances of Loki are `1x.extra-small`, `1x.small`, or `1x.medium`. Additionally, `1x.pico` is supported starting with {logging} 6.1. +<6> For new installations this date should be set to the equivalent of "yesterday", as this will be the date from when the schema takes effect. +<7> Specify the name of your log store secret. +<8> Specify the corresponding storage type. +<9> Specify the name of a storage class for temporary storage. For best performance, specify a storage class that allocates block storage. You can list the available storage classes for your cluster by using the `oc get storageclasses` command. +<10> The `openshift-logging` mode is the default tenancy mode where a tenant is created for log types, such as audit, infrastructure, and application. This enables access control for individual users and user groups to different log streams. . Apply the `LokiStack` CR object by running the following command: