chore: import lab6 baseline

This commit is contained in:
2026-11-01 17:59:39 +03:00
parent 20afc2c790
commit 69ec859cae
123 changed files with 18072 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
auth_enabled: false
server:
http_listen_address: 0.0.0.0
http_listen_port: 3100
grpc_listen_address: 0.0.0.0
grpc_listen_port: 9096
common:
path_prefix: /loki
replication_factor: 1
ring:
kvstore:
store: inmemory
storage:
filesystem:
chunks_directory: /loki/chunks
rules_directory: /loki/rules
schema_config:
configs:
- from: 2024-01-01
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h
limits_config:
allow_structured_metadata: true
retention_period: 168h
volume_enabled: true
otlp_config:
resource_attributes:
attributes_config:
- action: index_label
attributes:
- service.name
- deployment.environment.name
compactor:
working_directory: /loki/compactor
retention_enabled: true
delete_request_store: filesystem
analytics:
reporting_enabled: false
+36
View File
@@ -0,0 +1,36 @@
#!/bin/sh
set -eu
alias_name=bootstrap
policy_name=messenger-attachments
policy_file=/tmp/messenger-attachments-policy.json
mc alias set "$alias_name" http://s3:9000 "$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD"
mc mb --ignore-existing "$alias_name/$S3_BUCKET"
mc anonymous set none "$alias_name/$S3_BUCKET"
cat >"$policy_file" <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetBucketLocation", "s3:ListBucket"],
"Resource": ["arn:aws:s3:::$S3_BUCKET"]
},
{
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject", "s3:DeleteObject"],
"Resource": ["arn:aws:s3:::$S3_BUCKET/*"]
}
]
}
EOF
mc admin policy create "$alias_name" "$policy_name" "$policy_file"
mc admin user add "$alias_name" "$S3_ACCESS_KEY" "$S3_SECRET_KEY"
mc admin policy attach "$alias_name" "$policy_name" --user "$S3_ACCESS_KEY"
mc alias set application http://s3:9000 "$S3_ACCESS_KEY" "$S3_SECRET_KEY"
mc ls "application/$S3_BUCKET" >/dev/null
+16
View File
@@ -0,0 +1,16 @@
FROM golang:1.24.8-alpine3.22 AS build
ARG MC_VERSION
RUN apk add --no-cache git
RUN git clone --depth 1 --branch "${MC_VERSION}" https://github.com/minio/mc.git /src/mc
WORKDIR /src/mc
RUN go mod download
RUN LDFLAGS="$(MC_RELEASE=RELEASE go run buildscripts/gen-ldflags.go)" && \
GOMAXPROCS=2 GOMEMLIMIT=1GiB CGO_ENABLED=0 go build -p=1 -tags kqueue -trimpath -ldflags "$LDFLAGS" -o /out/mc .
FROM alpine:3.22.2
COPY --from=build /out/mc /usr/local/bin/mc
COPY infra/minio/bootstrap.sh /usr/local/bin/bootstrap.sh
ENTRYPOINT ["mc"]
+18
View File
@@ -0,0 +1,18 @@
FROM golang:1.24.8-alpine3.22 AS build
ARG MINIO_VERSION
RUN apk add --no-cache git
RUN git clone --depth 1 --branch "${MINIO_VERSION}" https://github.com/minio/minio.git /src/minio
WORKDIR /src/minio
RUN go mod download
RUN LDFLAGS="$(MINIO_RELEASE=RELEASE go run buildscripts/gen-ldflags.go)" && \
GOMAXPROCS=2 GOMEMLIMIT=1GiB CGO_ENABLED=0 go build -p=1 -tags kqueue -trimpath -ldflags "$LDFLAGS" -o /out/minio .
FROM alpine:3.22.2
RUN addgroup -S minio && adduser -S -G minio minio && mkdir /data && chown minio:minio /data
COPY --from=build /out/minio /usr/local/bin/minio
USER minio
VOLUME ["/data"]
ENTRYPOINT ["minio"]
+73
View File
@@ -0,0 +1,73 @@
extensions:
health_check:
endpoint: 0.0.0.0:13133
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
memory_limiter:
check_interval: 1s
limit_mib: 192
spike_limit_mib: 48
batch:
send_batch_size: 1024
send_batch_max_size: 2048
timeout: 2s
exporters:
prometheus:
endpoint: 0.0.0.0:8889
resource_constant_labels:
included:
- service.name
- service.version
- deployment.environment.name
otlp_grpc/tempo:
endpoint: tempo:4317
tls:
insecure: true
sending_queue:
enabled: true
num_consumers: 2
queue_size: 512
retry_on_failure:
enabled: true
initial_interval: 1s
max_interval: 5s
max_elapsed_time: 30s
otlp_http/loki:
endpoint: http://loki:3100/otlp
sending_queue:
enabled: true
num_consumers: 2
queue_size: 512
retry_on_failure:
enabled: true
initial_interval: 1s
max_interval: 5s
max_elapsed_time: 30s
service:
extensions: [health_check]
telemetry:
logs:
level: info
pipelines:
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [prometheus]
logs:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp_http/loki]
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp_grpc/tempo]
+48
View File
@@ -0,0 +1,48 @@
server:
http_listen_address: 0.0.0.0
http_listen_port: 3200
grpc_listen_address: 0.0.0.0
grpc_listen_port: 9095
distributor:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
ingester:
max_block_duration: 5m
compactor:
compaction:
block_retention: 168h
storage:
trace:
backend: local
wal:
path: /var/tempo/wal
local:
path: /var/tempo/traces
metrics_generator:
registry:
external_labels:
source: tempo
deployment_environment: lab
storage:
path: /var/tempo/generator/wal
remote_write:
- url: http://prometheus:9090/api/v1/write
send_exemplars: true
overrides:
defaults:
metrics_generator:
processors: [service-graphs, span-metrics]
usage_report:
reporting_enabled: false