Skip to content

Commit d67b4ed

Browse files
overtrueGatewayJ
authored andcommitted
fix: sync provisioned user credential rotation
1 parent c39ff90 commit d67b4ed

6 files changed

Lines changed: 236 additions & 33 deletions

File tree

deploy/rustfs-operator/crds/tenant-crd.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,9 @@ spec:
18951895
desiredHash:
18961896
nullable: true
18971897
type: string
1898+
lastAppliedAccessKeyHash:
1899+
nullable: true
1900+
type: string
18981901
lastAppliedGeneration:
18991902
format: int64
19001903
nullable: true
@@ -1951,6 +1954,9 @@ spec:
19511954
desiredHash:
19521955
nullable: true
19531956
type: string
1957+
lastAppliedAccessKeyHash:
1958+
nullable: true
1959+
type: string
19541960
lastAppliedGeneration:
19551961
format: int64
19561962
nullable: true
@@ -1995,6 +2001,9 @@ spec:
19952001
desiredHash:
19962002
nullable: true
19972003
type: string
2004+
lastAppliedAccessKeyHash:
2005+
nullable: true
2006+
type: string
19982007
lastAppliedGeneration:
19992008
format: int64
20002009
nullable: true

deploy/rustfs-operator/crds/tenant.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,9 @@ spec:
18951895
desiredHash:
18961896
nullable: true
18971897
type: string
1898+
lastAppliedAccessKeyHash:
1899+
nullable: true
1900+
type: string
18981901
lastAppliedGeneration:
18991902
format: int64
19001903
nullable: true
@@ -1951,6 +1954,9 @@ spec:
19511954
desiredHash:
19521955
nullable: true
19531956
type: string
1957+
lastAppliedAccessKeyHash:
1958+
nullable: true
1959+
type: string
19541960
lastAppliedGeneration:
19551961
format: int64
19561962
nullable: true
@@ -1995,6 +2001,9 @@ spec:
19952001
desiredHash:
19962002
nullable: true
19972003
type: string
2004+
lastAppliedAccessKeyHash:
2005+
nullable: true
2006+
type: string
19982007
lastAppliedGeneration:
19992008
format: int64
20002009
nullable: true

docs/operator-user-guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ ConfigMaps and user Secrets must live in the Tenant namespace. If managed outsid
476476

477477
For each `spec.users[]` entry, the operator reads a Secret with the same name as the user. The Secret must contain `accesskey` and `secretkey`, or the MinIO-compatible keys `CONSOLE_ACCESS_KEY` and `CONSOLE_SECRET_KEY`. If both key formats are present, their values must match. User access keys must be at least 8 characters and must not contain whitespace, `=`, or `,`; user secret keys must be at least 8 characters.
478478

479+
Updating a user Secret's `secretkey` rotates that RustFS user's credential. The `accesskey` is immutable after the first successful reconciliation; use a new user entry and Secret when it must change, then migrate clients before removing the old entry.
480+
479481
```yaml
480482
apiVersion: v1
481483
kind: ConfigMap

docs/operator-user-guide.zh-CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@ ConfigMap 和 user Secret 必须位于 Tenant namespace。若这些资源不是
478478

479479
每个 `spec.users[]` 条目都会读取一个与 user 名同名的 Secret。Secret 必须包含 `accesskey` 和 `secretkey`,或者 MinIO 兼容 key:`CONSOLE_ACCESS_KEY` 和 `CONSOLE_SECRET_KEY`。如果两种 key 同时存在,值必须一致。user access key 至少 8 个字符,且不能包含空白、`=` 或 `,`;user secret key 至少 8 个字符。
480480

481+
更新 user Secret 的 `secretkey` 会轮换对应 RustFS user 的凭据。首次成功 provisioning 后,`accesskey` 不可变;如需变更,请新建 user 条目和 Secret,迁移客户端后再移除旧条目。
482+
481483
```yaml
482484
apiVersion: v1
483485
kind: ConfigMap

0 commit comments

Comments
 (0)