Installation
Run a Logs database on Kubernetes: pick a deployment mode, declare it as a custom resource, and give each tenant namespace credentials.
This guide assumes the operator is already installed; see Installation. Examples use the telemetry Kubernetes namespace and an S3 bucket named acme-telemetry.
Choose a mode
| Mode | Pods | Storage | Use it for |
|---|---|---|---|
| Standalone | One pod that ingests and queries | A volume, or a bucket | Development and small clusters |
| Reader/writer split | One writer, autoscaled readers | A shared bucket | Heavy query load on modest ingest |
| Sharded | Several writers, a reader group per shard | A shared bucket | Ingest beyond one writer |
The split and sharded modes are the same Sharded resource with one writer or several, so a split deployment grows into a sharded one by raising spec.writer.replicas.
Grant S3 access
Skip this for a standalone database on a volume. Otherwise Logs authenticates to S3 with EKS Pod Identity. The operator creates a ServiceAccount named after the database, logs, so associate an IAM role with it:
aws eks create-pod-identity-association \
--cluster-name prod \
--namespace telemetry \
--service-account logs \
--role-arn arn:aws:iam::123456789012:role/plural-telemetry-logs{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::acme-telemetry"
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::acme-telemetry/logs/*"
}
]
}The role's trust policy must allow pods.eks.amazonaws.com to call sts:AssumeRole and sts:TagSession. No keys go in the spec.
Access
Logs serves a tenant namespace only once it has credentials. Each NamespaceAuthentication creates its namespace if needed and grants one username read or write. Create the password Secrets first:
kubectl -n telemetry create secret generic logs-payments-writer \
--from-literal=password="$(openssl rand -hex 24)"
kubectl -n telemetry create secret generic logs-payments-reader \
--from-literal=password="$(openssl rand -hex 24)"Then grant a writer for the collector and a reader for Grafana:
1apiVersion: telemetry.plural.sh/v1alpha12kind: NamespaceAuthentication3metadata:4 name: logs-payments-writer5 namespace: telemetry6spec:71 dataStoreRef: { kind: Logs, name: logs }82 namespace: payments93 username: otel-collector104 permission: write115 secretKeyRef: { name: logs-payments-writer, key: password }12---13apiVersion: telemetry.plural.sh/v1alpha114kind: NamespaceAuthentication15metadata:16 name: logs-payments-reader17 namespace: telemetry18spec:19 dataStoreRef: { kind: Logs, name: logs }20 namespace: payments21 username: grafana22 permission: read23 secretKeyRef: { name: logs-payments-reader, key: password }- 1dataStoreRefThe database this credential is for. One NamespaceAuthentication grants access to exactly one database.
- 2namespaceTenant namespace. It is created on first use; every route is prefixed with
/ns/{namespace}. - 3usernameHTTP basic-auth username. Unique per namespace.
- 4permission
writefor ingest routes,readfor queries. - 5secretKeyRefSecret holding the password, in the same Kubernetes namespace. Rotating it rolls the database's config.
Clients send these as HTTP basic auth.
Connect your tools
Writers serve ingest routes and readers serve queries. In the split and sharded modes, inside the cluster:
| Tool | URL |
|---|---|
| Grafana Loki data source | http://logs-reader.telemetry:3100/read/ns/payments |
Alloy / Promtail loki.write | http://logs-writer.telemetry:3100/write/ns/payments/loki/api/v1/push |
OTel Collector otlphttpThe exporter appends /v1/logs. | http://logs-writer.telemetry:3100/write/ns/payments/otlp |
Fluent Bit / Vector elasticsearchSpeaks the _bulk protocol. | http://logs-writer.telemetry:3100/write/ns/payments/elasticsearch |
A standalone database serves both from the one logs Service. Any writer accepts any entry and forwards it to the shard's owner, so the plain logs-writer Service is all a client needs. For an OTel Collector and Grafana:
extensions:
basicauth/plural:
client_auth:
username: otel-collector
password: ${env:PLURAL_LOGS_PASSWORD}
exporters:
otlphttp/plural-logs:
endpoint: http://logs-writer.telemetry:3100/write/ns/payments/otlp
auth:
authenticator: basicauth/plural
service:
extensions: [basicauth/plural]
pipelines:
logs:
exporters: [otlphttp/plural-logs]apiVersion: 1
datasources:
- name: Plural Logs
type: loki
url: http://logs-reader.telemetry:3100/read/ns/payments
basicAuth: true
basicAuthUser: grafana
secureJsonData:
basicAuthPassword: $PLURAL_LOGS_READ_PASSWORD