Skip to content

Instantly share code, notes, and snippets.

@rcmorano
Created January 17, 2025 10:02
Show Gist options
  • Save rcmorano/8ae09c13300d878b4c8f4aa4e75b6126 to your computer and use it in GitHub Desktop.
Save rcmorano/8ae09c13300d878b4c8f4aa4e75b6126 to your computer and use it in GitHub Desktop.
loki-values-example
data "template_file" "${eks_region_k}_${eks_name}_loki" {
template = <<EOT
loki:
enabled: true
isDefault: false
updateStrategy:
type: RollingUpdate
persistence:
enabled: true
accessModes:
- ReadWriteOnce
size: 10Gi
config:
auth_enabled: false
ingester:
chunk_idle_period: 3m
chunk_block_size: 262144
chunk_retain_period: 1m
max_transfer_retries: 0
lifecycler:
ring:
kvstore:
store: inmemory
replication_factor: 1
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 720h
schema_config:
configs:
- from: 2022-01-11
store: boltdb-shipper
object_store: s3
schema: v12
index:
prefix: index_
period: 24h
storage_config:
aws:
# S3 or S3-compatible URL to connect to. If only region is specified as a
# host, the proper endpoint will be deduced. Use inmemory:///<bucket-name> to
# use a mock in-memory implementation.
s3: s3://${eks_region_k}/${local.config.general.env-short}-${eks_region_k}-${eks_name}-loki
# Set to true to force the request to use path-style addressing
s3forcepathstyle: false
bucketnames: ${local.config.general.env-short}-${eks_region_k}-${eks_name}-loki
insecure: false
boltdb_shipper:
shared_store: s3
cache_ttl: 24h
chunk_store_config:
max_look_back_period: 720h
table_manager:
retention_deletes_enabled: true
retention_period: 720h
memberlist:
bind_addr:
- $MY_POD_IP
extraArgs:
config.expand-env: true
# Extra env variables to pass to the loki container
env:
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: AWS_REGION
valueFrom:
secretKeyRef:
name: loki-secrets
key: AWS_REGION
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: loki-secrets
key: AWS_ACCESS_KEY_ID
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: loki-secrets
key: AWS_SECRET_ACCESS_KEY
promtail:
enabled: true
pipelineStages:
- match:
selector: '{namespace!=""} |~ ".*kube-probe/.*" !~ ".*stdout F $"'
EOT
vars = {
clusterName = jsondecode(var.eks_clusters_json).eks_cluster_${eks_region_k}_${eks_name}.eks_info.eks_cluster_id
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment