feat(storage): support public s3 endpoint for browser uploads and update k8s example

This commit is contained in:
yiling
2026-10-18 14:02:32 +08:00
parent 60e4cad951
commit f34073e7f6
6 changed files with 84 additions and 27 deletions
+6 -11
View File
@@ -101,20 +101,15 @@ kubectl port-forward -n shumai svc/shumai-server 3000:3000
```
Open your browser to **`http://localhost:3000`**.
#### Step B: Enable In-Cluster S3 Media Uploads
Shumai uses direct client-to-S3 pre-signed URLs for high-throughput uploads. For your local browser to upload directly to the in-cluster Garage S3 service:
#### Step B: Port-forward In-Cluster S3 Storage (Garage)
Shumai generates direct client-to-S3 presigned URLs configured via `AWS_PUBLIC_ENDPOINT_URL_S3` (`http://localhost:3900`). To allow your browser to upload and stream media files directly:
1. Forward the Garage S3 API port (3900):
```bash
kubectl port-forward -n shumai svc/garage 3900:3900
```
2. Map the cluster S3 domain name to `127.0.0.1` in your local `/etc/hosts`:
```bash
echo "127.0.0.1 garage.shumai.svc.cluster.local" | sudo tee -a /etc/hosts
```
```bash
kubectl port-forward -n shumai svc/garage 3900:3900
```
> [!NOTE]
> **Production Environments**: In production cloud clusters (AWS EKS, GKE, self-hosted), you would configure an Ingress controller (e.g. `ingress-nginx` or AWS ALB) with a public domain or point `AWS_ENDPOINT_URL_S3` to an external cloud S3/R2 bucket so port-forwarding and `/etc/hosts` mappings are not required.
> **Production Environments**: In production cloud clusters (AWS EKS, GKE, self-hosted), you would configure an Ingress controller (e.g. `ingress-nginx` or AWS ALB) with a public domain or point `AWS_ENDPOINT_URL_S3` to an external cloud S3/R2 bucket.
---
+2
View File
@@ -38,6 +38,8 @@ spec:
env:
- name: SHUMAI_WORKERS
value: 'agent'
- name: AWS_PUBLIC_ENDPOINT_URL_S3
value: 'http://localhost:3900'
envFrom:
- configMapRef:
name: shumai-config