You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 457ba39
Browse filesBrowse the repository at this point in the historyBrowse files
docs(backups): stop presenting admin-only demo steps as tenant work
The kafka and nats walkthroughs put steps 03, 04, 06, 07 and cleanup
under the tenant persona, and the scenario docs and helper comments
had the tenant create the backup Secret. The scripts read, create and
delete Secrets, wait on HelmReleases, COSI objects and operator
resources, exec into a CLI Pod, read Pod logs, and delete the Backup
and the cluster-scoped BackupClass and strategy. The tenant roles grant
none of that, so a tenant following the docs hit Forbidden at the
first read. The tables now say admin and name the part a tenant admin can
do on its own, and the scenario docs say the same.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <[email protected]>
A cluster administrator performs the cluster-level preparation once. Tenants
4
-
will then be able to back up and restore the topic data of their Kafka
5
-
applications by referencing the BackupClass created here, with no further
6
-
admin action.
3
+
A cluster administrator performs the cluster-level preparation once. Tenant admins can then back up and restore the topic data of their Kafka applications with a `BackupJob` or `RestoreJob` that references the BackupClass created here. The demo scripts around those jobs still need admin access, because they create Secrets and work through a CLI Pod; the README's step table says which part of each step a tenant admin can do.
7
4
8
5
## Prerequisites
9
6
10
7
- A running Cozystack cluster with the backup-controller and
11
8
backupstrategy-controller installed.
12
9
-`kubectl` access with permissions to create cluster-scoped
13
10
`Job.strategy.backups.cozystack.io` and `BackupClass.backups.cozystack.io`.
14
-
- Reachable S3-compatible storage. The demo uses the in-cluster `Bucket` app
15
-
(step 03); the tenant turns its coordinates and the endpoint's CA into a
16
-
`<app>-backup-s3` Secret that the strategy Pod reads (step 04 / 07).
11
+
- Reachable S3-compatible storage. The demo uses the in-cluster `Bucket` app (step 03), and steps 04 and 07 turn its coordinates and the endpoint's CA into a `<app>-backup-s3` Secret that the strategy Pod reads. Creating that Secret needs admin access, since no tenant role grants `create` on `secrets`.
Copy file name to clipboardExpand all lines: examples/backups/kafka/91-scenario-user-backup.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,13 @@
2
2
3
3
This scenario assumes the admin steps (`01-...`, `02-...`) have already run.
4
4
5
+
The user's own action here, at the tenant admin level, is the `BackupJob` in step 05, plus creating the `Bucket` and the `Kafka`. Steps 03 and 04 as scripted need admin access: they read and create Secrets, wait on HelmReleases and operator resources, and seed the topic through a CLI Pod, which no tenant role allows. The README's step table has the details.
6
+
5
7
## Prerequisites
6
8
7
9
- Tenant namespace (default: `tenant-root`, the tenant whose Pods can reach
8
10
the in-cluster seaweedfs; see the README).
9
-
- A Cozystack `Bucket` (step 03) and the `<app>-backup-s3` Secret derived from
10
-
it (step 04). The generic `Job` strategy has no chart support to emit this
11
-
Secret, so the tenant creates it from the bucket's `BucketInfo` plus the S3
12
-
endpoint's CA (see `create_s3_secret` in `00-helpers.sh`).
11
+
- A Cozystack `Bucket` (step 03) and the `<app>-backup-s3` Secret derived from it (step 04). The generic `Job` strategy has no chart support to emit this Secret, so step 04 creates it from the bucket's `BucketInfo` plus the S3 endpoint's CA (see `create_s3_secret` in `00-helpers.sh`). Creating it needs admin access.
13
12
- A `Kafka` application with at least one plain (neither compacted nor
Copy file name to clipboardExpand all lines: examples/backups/kafka/92-scenario-user-restore.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ Two restore variants are supported. Both append: the strategy recreates a
4
4
topic only if it is absent and then replays every record, so it refuses a
5
5
target topic that already holds data.
6
6
7
+
The user's own action in both variants, at the tenant admin level, is the `RestoreJob`, plus the second `Kafka` in variant B. The scripts as written need admin access: variant A deletes and checks the topic through a CLI Pod and reads the refused restore's Pod log, and variant B checks the topic the same way, creates the target's Secret and waits on its `HelmRelease` and Strimzi `Kafka`, none of which a tenant role allows. The README's step table has the details.
Copy file name to clipboardExpand all lines: examples/backups/kafka/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,15 +36,15 @@ For a faithful, offset-preserving Kafka backup, prefer a volume-snapshot strateg
36
36
|`00-helpers.sh`| Shared bash helpers, env defaults, and the kafka-CLI / S3-secret helpers; sourced by every step. | n/a |
37
37
|`01-create-strategy.sh`| Creates the cluster-scoped `Job` strategy (the Kafka backup/restore `PodTemplateSpec`). | admin |
38
38
|`02-create-backupclass.sh`| Maps `apps.cozystack.io/Kafka` to that strategy, with the `topics` parameter (and the optional `replicationFactor` override). | admin |
39
-
|`03-create-bucket.sh`| Provisions a `Bucket` and caches its S3 coordinates plus the endpoint's CA into `.bucket-info.env` (chmod 600; raw access keys). `cleanup.sh` removes this file. |tenant, **plus admin** for the CA copy: it reads a Secret in `tenant-root`, which a tenant persona is not granted (see the TLS bullet above) |
40
-
|`04-create-kafka.sh`| Provisions a two-broker `Kafka`, creates the `<app>-backup-s3` Secret, seeds a topic (replication factor 2) with sentinel messages. | tenant |
39
+
|`03-create-bucket.sh`| Provisions a `Bucket` and caches its S3 coordinates plus the endpoint's CA into `.bucket-info.env` (chmod 600; raw access keys). `cleanup.sh` removes this file. |**admin**. A tenant admin can create the `Bucket` itself, but the script also waits on its `HelmRelease` and COSI objects, reads the `bucket-<name>-backup` Secret, and copies the CA from a Secret in `tenant-root`(see the TLS bullet above); no tenant role grants access to `helmreleases` or `objectstorage.k8s.io`, or `get` on those Secrets|
40
+
|`04-create-kafka.sh`| Provisions a two-broker `Kafka`, creates the `<app>-backup-s3` Secret, seeds a topic (replication factor 2) with sentinel messages. |**admin**. A tenant admin can create the `Kafka` itself, but the script also waits on its `HelmRelease` and Strimzi `Kafka`, creates the Secret, and seeds the topic through a CLI Pod it execs into; no tenant role grants access to `helmreleases` or `kafkas.kafka.strimzi.io`, `create` on `secrets` or `pods`, or `pods/exec`|
41
41
|`05-create-backupjob.sh`| Submits a `BackupJob`, waits for Succeeded and caches the resolved `Backup` name into `.backup-name.env`. | tenant |
42
-
|`06-restore-in-place.sh`| Deletes the topic and restores it into the same instance via `RestoreJob`, then submits a second `RestoreJob` that must be refused because the topic is no longer empty. | tenant |
43
-
|`07-restore-to-copy.sh`| Provisions a second two-broker `Kafka` and restores into it via `RestoreJob.spec.targetApplicationRef`. | tenant |
44
-
|`cleanup.sh`| Removes everything created by the demo. | admin or tenant |
42
+
|`06-restore-in-place.sh`| Deletes the topic and restores it into the same instance via `RestoreJob`, then submits a second `RestoreJob` that must be refused because the topic is no longer empty. |**admin**. A tenant admin can submit the two `RestoreJob`s, but the script deletes and checks the topic through the CLI Pod and reads the refusal from the restore Pod's log; no tenant role grants `create` on `pods` or `pods/exec`, or `get` on `pods/log`|
43
+
|`07-restore-to-copy.sh`| Provisions a second two-broker `Kafka` and restores into it via `RestoreJob.spec.targetApplicationRef`. |**admin**, for the same reasons as step 04. The tenant admin's part is the second `Kafka` and the `RestoreJob`|
44
+
|`cleanup.sh`| Removes everything created by the demo. |**admin**: it deletes Secrets, the `Backup`, and the cluster-scoped `BackupClass` and strategy, and no tenant role grants `delete` on any of them|
45
45
|`run-all.sh`| Convenience runner that executes 01..07 in order. | demo |
46
46
47
-
The scenario walk-throughs `90-scenario-admin-prepare.md`, `91-scenario-user-backup.md` and `92-scenario-user-restore.md` describe the same steps from the admin's and the tenant's side.
47
+
The scenario walk-throughs `90-scenario-admin-prepare.md`, `91-scenario-user-backup.md` and `92-scenario-user-restore.md` describe the same steps from the admin's and the tenant's side, and say which parts of the tenant's side need admin access.
0 commit comments