Repository navigation
Support force_path_style for self-hosted S3-compatible object storage #2584
FredPraca
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is there an existing discussion that is already proposing this?
What part(s) of Encore does this feature request apply to?
Is your feature request related to a problem? Please describe it
This is related to the opened PR #2115
Describe the solution you'd like
Hi,
We're running Encore in a self-hosted Kubernetes environment and using SeaweedFS as an S3-compatible object storage backend.
Our
infra-config.jsoncontains an S3 endpoint similar to:{ "object_storage": [ { "type": "s3", "region": "us-east-1", "endpoint": "http://seaweed-cluster.default.svc.cluster.local:8333", "access_key_id": "...", "secret_access_key": { "$env": "AWS_SECRET_ACCESS_KEY" }, "buckets": { "attachments": { "name": "attachments" } } } ] }The bucket is declared normally in the application:
Problem
Encore's S3 client uses virtual-hosted-style addressing even when a custom S3 endpoint is configured.
With runtime tracing enabled, we can see the actual request being generated:
This results in a DNS error:
The configured endpoint itself is reachable and resolves correctly from the same application pod:
The problem is that virtual-hosted-style addressing changes the hostname to:
which is not a Kubernetes Service DNS name.
For an S3-compatible service running inside Kubernetes, the expected request is instead path-style:
Existing PR
I found #2115, which appears to implement exactly what is needed by adding
force_path_styleto the S3 infrastructure configuration and propagating it to the AWS Rust SDK:with configuration along the lines of:
{ "type": "s3", "endpoint": "http://seaweed-cluster.default.svc.cluster.local:8333", "force_path_style": true }However, it looks like #2115 was never merged.
Would you consider reviving/merging this functionality, or accepting a new PR based on it?
This option seems important for self-hosted deployments using S3-compatible implementations such as SeaweedFS, MinIO, Ceph, etc. Without it, the alternatives in Kubernetes involve DNS wildcard/rewrite workarounds solely to accommodate the S3 client's addressing mode.
Having an explicit
force_path_stylesetting also seems preferable to automatically enabling path-style for custom endpoints, since it preserves the existing behavior for S3-compatible providers that support virtual-hosted-style addressing.Thanks!
What is the motivation / use case for changing the behavior?
Allowing to use one of the standard way to address S3 resources.
All reactions