Files
k3s/009-基础设施/002-s3/note.md
2026-02-05 00:11:05 +08:00

65 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
1. MinIO 配置已更新
- MINIO_SERVER_URL: https://s3.u6.net3w.com
- MINIO_BROWSER_REDIRECT_URL: https://console.s3.u6.net3w.com
2. MinIO 日志确认
API: https://s3.u6.net3w.com
WebUI: https://console.s3.u6.net3w.com
3. 访问测试通过
- https://s3.u6.net3w.com - 正确重定向到 Console不再显示端口号
- https://console.s3.u6.net3w.com - 直接访问 Console
访问方式:
- Web 控制台: https://console.s3.u6.net3w.com
- S3 API 端点: https://s3.u6.net3w.com
- 登录凭证:
- 用户名: admin
- 密码: adminks..
配置文件位置:
- MinIO: /home/fei/k3s/009-基础设施/002-s3/minio.yaml
- Caddy: /home/fei/k3s/caddy-ssl-deployment.yaml
所有服务已正常运行,可以开始使用 MinIO 对象存储了!
不如固定桶名?
在对象存储的使用习惯中“频繁创建桶”其实是一种反模式Anti-pattern
建议方案:创建一个名为 public-assets 的固定桶,并将其设为 download 权限。
管理方式:不同的业务或用户,通过 文件夹Prefix 来区分,例如 public-assets/user1/public-assets/user2/。
结果:你只需要在部署 Pod 时设置一次权限,之后所有上传到该桶下的文件自动就能下载。
配置完成: ─
从日志可以看到:
Policy manager started. Monitoring buckets...
Setting download policy for bucket: test
Access permission for `myminio/test` is set to `download`
功能说明:
1. 自动检测 - 每 30 秒扫描一次所有存储桶
2. 自动设置 - 发现私有PRIVATE存储桶时自动设置为 download公开只读
3. 已处理 - 你的 test 存储桶已自动设置为公开只读权限
权限效果:
- ✅ 任何人都可以下载文件(无需认证)
- ✅ 上传/删除需要认证Access Key + Secret Key
测试方法:
# 现在可以直接访问 test 桶中的文件(无需认证)
curl https://s3.u6.net3w.com/test/your-file.txt
后续使用:
- 新创建的任何存储桶都会在 30 秒内自动设置为公开只读
- 如果需要保持某个桶为私有,可以在 Web 控制台手动改回 PRIVATE
- Policy manager 只会处理完全私有的桶,不会覆盖已设置的策略
配置已生效,可以继续使用了!