Loki 3.x 설치하고 S3 기반 TSDB 설정하기
U
uniglot
- Monitoring
- Kubernetes
- Loki
- Log

loki:
schemaConfig:
configs:
- from: "2025-01-22"
store: tsdb
object_store: s3
schema: v13
index:
prefix: loki_index_
period: 24h
loki:
schemaConfig:
# omit
minio:
enabled: falseloki:
schemaConfig:
# omit
storage_config:
tsdb_shipper:
active_index_directory: "/var/loki/index"
cache_location: "/var/loki/index_cache"
cache_ttl: 24h
aws:
region: ap-northeast-2
bucketnames: testtest-loki-chunk
storage:
type: s3
bucketNames:
chunk: testtest-loki-chunk
ruler: testtest-loki-ruler
s3:
region: ap-northeast-2
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::testtest-loki-chunk",
"arn:aws:s3:::testtest-loki-chunk/*",
"arn:aws:s3:::testtest-loki-ruler",
"arn:aws:s3:::testtest-loki-ruler/*",
]
}
]
}{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::<계정 아이디 숫자>:oidc-provider/oidc.eks.ap-northeast-2.amazonaws.com/id/<OIDC 아이디>"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"oidc.eks.ap-northeast-2.amazonaws.com/id/<OIDC 아이디>:sub": "system:serviceaccount:<로키 네임스페이스>:<로키 서비스 어카운트 이름>",
"oidc.eks.ap-northeast-2.amazonaws.com/id/<OIDC 아이디>:aud": "sts.amazonaws.com"
}
}
}
]
}loki:
# omit
serviceAccount:
create: true
name: testtest-loki-sa
annotations:
"eks.amazonaws.com/role-arn": "arn:aws:iam::<계정 아이디 숫자>:role/testtest-loki"backend:
replicas: 2
read:
replicas: 2
write:
replicas: 2config:
clients:
- url: "http://loki-gateway/loki/api/v1/push"
tenant_id: 1affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "eks.amazonaws.com/compute-type"
operator: NotIn
values:
- fargateloki:
schemaConfig:
configs:
- from: "2025-01-22"
store: tsdb
object_store: s3
schema: v13
index:
period: 24h
prefix: loki_index_
limits_config:
allow_structured_metadata: true
volume_enabled: true
storage_config:
tsdb_shipper:
active_index_directory: "/var/loki/index"
cache_location: "/var/loki/index_cache"
cache_ttl: 24h
aws:
region: ap-northeast-2
bucketnames: testtest-loki-chunk
storage:
type: s3
bucketNames:
chunk: testtest-loki-chunk
ruler: testtest-loki-ruler
s3:
region: ap-northeast-2
serviceAccount:
create: true
name: testtest-loki-sa
annotations:
"eks.amazonaws.com/role-arn": "arn:aws:iam::<계정 아이디 숫자>:role/testtest-loki"
backend:
replicas: 2
read:
replicas: 2
write:
replicas: 2
minio:
enabled: false
config:
clients:
- url: "http://loki-gateway/loki/api/v1/push"
tenant_id: 1
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "eks.amazonaws.com/compute-type"
operator: NotIn
values:
- fargate