Override ConfigMap to Modify the Storage Retention Period in Project Grafana Loki

DKP configures Project Grafana Loki to retain log metadata and logs for 1 week, using the Compactor. This retention policy can be customized.
The minimum retention period is 24h.
To customize the retention policy using configOverrides, run these commands on the management cluster:
Determine the namespace of the workspace that your project is in. You can use the
dkp get workspacescommand to see the list of workspace names and their corresponding namespaces.CODEdkp get workspacesCopy the value under the
NAMESPACEcolumn for your workspace. This may NOT be identical to the Display Name of theWorkspace.Set the
WORKSPACE_NAMESPACEvariable to the namespace copied in the previous step:CODEexport WORKSPACE_NAMESPACE=<WORKSPACE_NAMESPACE>Get the namespace of your project:
CODEkubectl get projects --namespace ${WORKSPACE_NAMESPACE}Copy the value under the
PROJECT NAMESPACEcolumn for your workspace. This may NOT be identical to the Display Name of theProject.Set the
PROJECT_NAMESPACEvariable to the namespace copied in the previous step:CODEexport PROJECT_NAMESPACE=<PROJECT_NAMESPACE>Create a
ConfigMapwith custom configuration values for Grafana Loki. Since the retention configuration is nested in aconfigstring, you must copy the entire block. The following example sets the retention period under to 360 hours (15 days). Refer to Grafana Loki’s Retention Configuration documentation for more information about this field.CODEcat <<EOF | kubectl apply -f - apiVersion: v1 kind: ConfigMap metadata: name: project-grafana-loki-custom-overrides namespace: ${PROJECT_NAMESPACE} data: values.yaml: | loki: structuredConfig: limits_config: retention_period: 360h EOFRun the following command on the management cluster to reference the
configOverridesin theproject-grafana-lokiAppDeployment:CODEcat <<EOF | kubectl apply -f - apiVersion: apps.kommander.d2iq.io/v1alpha3 kind: AppDeployment metadata: name: project-grafana-loki namespace: ${PROJECT_NAMESPACE} spec: appRef: name: project-grafana-loki-0.48.6 kind: ClusterApp configOverrides: name: project-grafana-loki-custom-overrides EOF