Skip to content

3.6: region requirement when using s3 in compactor #20158

@danbka33

Description

@danbka33

Describe the bug

base values.yaml:

# @default -- See values.yaml
loki:
 config.
  storage:
    # Loki requires a bucket for chunks and the ruler. GEL requires a third bucket for the admin API.
    # Please provide these values if you are using object storage.
    bucketNames:
      chunks: ${LOKI_S3_BUCKET_NAME}
      ruler: ${LOKI_S3_BUCKET_NAME}
      admin: ${LOKI_S3_BUCKET_NAME}
    type: s3
    s3:
      s3: "s3://${LOKI_S3_BUCKET_NAME}"
      endpoint: "http://${LOKI_S3_BUCKET_HOST}:${LOKI_S3_BUCKET_PORT}"
      region: "${LOKI_S3_BUCKET_REGION}"
      secretAccessKey: "${LOKI_S3_SECRET_ACCESS_KEY}"
      accessKeyId: "${LOKI_S3_ACCESS_KEY_ID}"
      signatureVersion: "v4"
      s3ForcePathStyle: true
      insecure: true
      http_config: {}

additional production values.yaml:

loki:
  image:
    tag: 3.6.2
  limits_config:
    retention_period: 60d
  compactor:
    working_directory: /var/loki/compactor
    compaction_interval: 30m
    retention_enabled: true
    retention_delete_delay: 2h
    delete_request_store: s3

I get error with crash:

failed to init delete store: failed to get s3 object: operation error S3: GetObject, failed to resolve service endpoint, endpoint rule error, A region must be set when sending requests to S3

But if you don't enable retention, Loki handles empty regions in the s3 settings well.

I pass bucket configuration via generated configmap from cluster ceph operator.

apiVersion: v1
data:
  BUCKET_HOST: rook-ceph-rgw-ceph-objectstore.rook-ceph.svc
  BUCKET_NAME: NDA-monitoring-loki-bu-afa1808b-ab32-400e-b84e-662b70423daa
  BUCKET_PORT: "80"
  BUCKET_REGION: ""
  BUCKET_SUBREGION: ""
kind: ConfigMap
metadata:
  name: NDA-monitoring-loki-bucket

To Reproduce
Steps to reproduce the behavior:

  1. Started Loki 3.6.2
  2. Enable retention
  3. Set S3 region to empty value
  4. Got crash

Expected behavior
Correct handling empty region on custom s3 providers.

Environment:

  • Infrastructure: Kubernetes
  • Deployment tool: helm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions