docs: define Instance domain model and admin Secret boundary
E2E Tests / Run on Ubuntu (pull_request) Failing after 1m21s
Tests / Run on Ubuntu (pull_request) Successful in 4m12s
Lint / Run on Ubuntu (pull_request) Successful in 4m37s

This commit is contained in:
2026-09-13 12:17:03 +00:00
parent 59303f5276
commit 953878ac47
7 changed files with 399 additions and 27 deletions
+11 -6
View File
@@ -37,13 +37,15 @@ cluster-scoped,short name 为 `pginstance`。
| `spec.endpoint.port` | int32 | `5432` | 1–65535 |
| `spec.endpoint.database` | string | `postgres` | 管理连接 database;合法 PostgreSQL identifier |
| `spec.endpoint.sslMode` | enum | `verify-full` | `disable`、`require`、`verify-ca`、`verify-full` |
| `spec.adminCredentialRef.path` | string | 必填 | 部署级 KV mount 内的 mount-relative path |
| `spec.adminCredentialRef.usernameKey` | string | `username` | OpenBao record 中的键名 |
| `spec.adminCredentialRef.passwordKey` | string | `password` | OpenBao record 中的键名 |
| `spec.adminCredentialRef.name` | string | 必填 | controller namespace 内的管理 Secret 名称 |
| `spec.adminCredentialRef.usernameKey` | string | `username` | Secret data 中的键名 |
| `spec.adminCredentialRef.passwordKey` | string | `password` | Secret data 中的键名 |
| `spec.allowedExtensions` | set[string] | 空集合 | 合法 extension 名称的 allowlist |
`adminCredentialRef.path` 不以 `/` 开头,不含空段、`.`、`..`,也不包含 KV v2 API 的
`data`/`metadata` 层。它只定位既有管理凭据;controller 不创建或修改该记录。
`adminCredentialRef` 不接受 namespace 或 Bao path。管理 Secret 固定在 controller
namespace,名称须合法,两个字段须存在且非空。管理员维护 ExternalSecret,由 ESO
同步;controller 只读管理 Secret,不创建或修改它。此为 2026-09-13 批准的修订,
现有 API types、生成 CRD 和 samples 尚未更新。
Instance endpoint、管理凭据引用和 allowlist 可以修改。修改后 controller 重新验证;
删除 allowlist 项目不会自动从已有 Tenant database 删除 extension。
@@ -62,6 +64,9 @@ print columns:`Endpoint=.spec.endpoint.host`、`Phase`、`Ready`、`Age`。
Instance `Ready=True` 要求管理凭据可读、TLS/认证成功、server metadata 可读、registry
可访问且权限预检成功。它不代表数据库已经备份或高可用。
管理凭据从 Kubernetes Secret 装配;已有有效凭据可访问 PostgreSQL 时,Bao/ESO
暂时不可用不单独撤销 Instance Ready。Tenant 凭据操作仍依赖 Bao。
## PostgreSQLTenant
namespaced,short name 为 `pgtenant`。
@@ -160,7 +165,7 @@ spec:
database: postgres
sslMode: verify-full
adminCredentialRef:
path: infrastructure/postgresql/shared/admin
name: shared-postgresql-admin
allowedExtensions: [pg_trgm]
---
apiVersion: database.ddupan.top/v1alpha1