Skip to content

Commit

Permalink
reuse storage config block
Browse files Browse the repository at this point in the history
  • Loading branch information
fcjack committed Feb 6, 2025
1 parent 99163c1 commit 8fa76f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
13 changes: 10 additions & 3 deletions production/helm/loki/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1150,9 +1150,10 @@ This function needs to be called with a context object containing the following
the thanos_storage_config model*/}}
{{- define "loki.thanosStorageConfig" -}}
{{- $bucketName := .bucketName }}
{{- with .ctx.Values.loki.storage.object_store }}
{{- with .ctx.Values.loki.storage }}
{{- if eq .type "s3" }}
s3:
{{- with .s3 }}
bucket_name: {{ $bucketName }}
{{- with .endpoint }}
endpoint: {{ . }}
Expand All @@ -1171,26 +1172,32 @@ s3:
{{- end }}
{{- with .http }}
http:
{{ toYaml . | indent 4 }}
{{ toYaml . | nindent 4 }}
{{- end }}
{{- with .sse }}
sse:
{{ toYaml . | indent 4 }}
{{ toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- else if eq .type "gcs" }}
gcs:
bucket_name: {{ $bucketName }}
{{- with .gcs }}
{{- with .service_account }}
service_account: {{ . }}
{{- end }}
{{- end }}
{{- else if eq .type "azure" }}
azure:
{{- with .azure }}
container_name: {{ $bucketName }}
{{- with .account_name }}
account_name: {{ . }}
{{- end }}
{{- with .account_key }}
account_key: {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- with .prefix }}
prefix: {{ . }}
Expand Down
24 changes: 0 additions & 24 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -393,30 +393,6 @@ loki:
# Loki now supports using thanos storage clients for connecting to object storage backend.
# This will become the default way to configure storage in a future releases.
use_thanos_objstore: false
object_store:
# Type of object store. Valid options are: S3, GCS, AZURE
type: s3
prefix: null # Optional prefix for storage keys

# S3 configuration (when type is "S3")
s3:
endpoint: null # S3 endpoint URL
region: null # Optional region
access_key_id: null # Optional access key
secret_access_key: null # Optional secret key
insecure: false # Optional. Enable if using self-signed TLS
sse: {} # Optional server-side encryption configuration
http: {} # Optional HTTP client configuration

# GCS configuration (when type is "GCS")
gcs:
bucket_name: null # Name of the bucket
service_account: null # Optional service account JSON

# Azure configuration (when type is "AZURE")
azure:
account_name: null # Storage account name
account_key: null # Optional storage account key

# -- Configure memcached as an external cache for chunk and results cache. Disabled by default
# must enable and specify a host for each cache you would like to use.
Expand Down

0 comments on commit 8fa76f9

Please sign in to comment.