How to connect object storage to Loki on Juju¶
Loki on Juju needs an S3-compatible object store for durable storage. The
Juju deployment does not create that object store for you; it expects you
to bring an existing one and connect it through the s3-integrator charm.
Use this guide to connect an existing object store to a Loki on Juju deployment.
Note
Loki on Juju guides
Before you begin¶
You should already have:
A Loki on Juju deployment (at minimum the
loki-coordinator-k8sapplication). If you do not have one yet, follow How to deploy Loki on Juju first.Access to an S3-compatible object store, with:
endpoint
bucket name
access key
secret key
optional region
optional custom CA chain for HTTPS
If you still need a local test object store, see How to deploy Minio and S3 Integrator.
Plan your object storage¶
Do this before wiring anything into Loki; changing the answer to any of these later is disruptive.
Use a dedicated bucket. Keep Loki in its own bucket unless you have a clear reason to share one.
Use dedicated credentials for that bucket, scoped so they can only access what Loki needs.
Prefer HTTPS for the S3 endpoint in shared or production environments, and know in advance whether the endpoint uses a private CA (you will need to supply the CA chain during configuration).
Do not use Minio in production. The Minio charm is only for local or disposable test environments; production planning is covered in Storage best practices.
Plan capacity around your retention and ingestion rates, and avoid local-only or node-bound storage for production deployments. Sizing details are in Storage best practices.
Keep the S3 endpoint stable before you start wiring producers to the
loggingendpoint; changing it later forces a reconfiguration of Loki workers.
Warning
The Minio charm is useful for testing, but not as a production storage strategy. For production planning, review Storage best practices.
1. Deploy the S3 integrator¶
juju deploy s3-integrator loki-s3 --channel latest/stable --trust
The application will remain blocked until you give it credentials and a target bucket.
2. Create and grant the S3 credentials secret¶
Create a Juju secret holding the access key and secret key, then grant that
secret to the loki-s3 application:
juju add-secret loki-s3-credentials \
access-key=<access-key> \
secret-key=<secret-key>
juju grant-secret secret:<secret-ID> loki-s3
3. Configure the object-store location¶
Set the endpoint and bucket:
juju config loki-s3 \
credentials=secret:<secret-ID> \
endpoint=<s3-endpoint> \
bucket=<bucket-name>
Depending on your object-store implementation, you may also need additional options such as:
region=<region>path=<prefix>s3-uri-style=path
If the endpoint uses a private CA, provide it as base64:
juju config loki-s3 tls-ca-chain="$(base64 -w0 ca-chain.pem)"
4. Integrate Loki with the S3 integrator¶
juju integrate loki:s3 loki-s3:s3-credentials
If you are still building the deployment, integrate storage before joining Loki workers to the coordinator. That keeps the storage configuration in place before the workers read their cluster settings.
5. Verify the relation¶
juju status --relations
You should see an s3 integration between loki and loki-s3, and both
applications should reach active/idle.