Tenant(租户)
当前版本的 tenant 运行时数据来自 PostgreSQL tenants 表,而不是 Redis 动态配置。
当前运行时会读取的字段
id:租户唯一标识,routes.tenant_id、consumers.tenant_id、upstreams.tenant_id都会引用它name:租户名称,主要用于日志和调试status:当前建议使用active / disabledinbound_rate_limit_qps:租户级入口 QPS 限额;大于0时可驱动 inbound rate limitdetect_rate_limit_cpm:Guard 检测字符速率限额;大于0时可驱动 detect 限速metadata:扩展信息
当前实现状态
当前 PG runtime 已经实际使用:
idnameinbound_rate_limit_qpsdetect_rate_limit_cpm
这些字段会在路由解析阶段被重建到内部运行态 tenant 对象中,继续复用现有插件体系。
数据来源
tenant 通常通过以下方式初始化:
- migration 建表
- seed profile 写入
- 后续控制面或脚本直接写 PG
本地联调推荐看: