Skip to content

Commit e11d10b

Browse files
stuggiclaude
andcommitted
[b/r] Rename backup labels to backup.openstack.org/ prefix in docs
Update all label references in docs/dev/backup-restore/ from openstack.org/backup-* to backup.openstack.org/* prefix: - backup.openstack.org/restore (was openstack.org/backup-restore) - backup.openstack.org/category (was openstack.org/backup-category) - backup.openstack.org/restore-order (was openstack.org/backup-restore-order) - backup.openstack.org/backup (was openstack.org/backup) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3f0aa8e commit e11d10b

16 files changed

Lines changed: 169 additions & 169 deletions

docs/dev/backup-restore/backup-restore-controller-design.md

Lines changed: 102 additions & 102 deletions
Large diffs are not rendered by default.

docs/dev/backup-restore/backup-restore-controller-implementation.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ All repositories use a `backup_restore` branch for this work.
1717
1. **CRD labels** declare which types participate in backup/restore
1818
2. **OpenStackBackupConfig controller** labels CR instances and user-provided resources (Secrets, ConfigMaps, NADs)
1919
3. **Operators** label managed resources they create (PVCs, database password secrets)
20-
4. **OADP** backs up all resources, restores selectively using `openstack.org/backup-restore` labels
20+
4. **OADP** backs up all resources, restores selectively using `backup.openstack.org/restore` labels
2121

2222
**Two Labeling Mechanisms:**
2323

@@ -34,9 +34,9 @@ All repositories use a `backup_restore` branch for this work.
3434
- `backup.GetRestoreLabels()` for resource instance labels
3535
- `backup.BuildCRDLabelCache()` for CRD label cache
3636
- **Use label constants**: Always use constants from `backup` package for label keys
37-
- `backup.BackupRestoreLabel` = `"openstack.org/backup-restore"`
38-
- `backup.BackupCategoryLabel` = `"openstack.org/backup-category"`
39-
- `backup.BackupRestoreOrderLabel` = `"openstack.org/backup-restore-order"`
37+
- `backup.BackupRestoreLabel` = `"backup.openstack.org/restore"`
38+
- `backup.BackupCategoryLabel` = `"backup.openstack.org/category"`
39+
- `backup.BackupRestoreOrderLabel` = `"backup.openstack.org/restore-order"`
4040
- Never hardcode label strings
4141
- **Return maps, don't modify in-place**: Functions should return label/annotation maps, not modify objects directly
4242
- **Use CreateOrPatch pattern**: Operators typically use CreateOrPatch or CreateOrUpdate (not direct Create)
@@ -70,9 +70,9 @@ package backup
7070

7171
const (
7272
// Label keys for CRD metadata (declare backup behavior for the type)
73-
BackupRestoreLabel = "openstack.org/backup-restore" // CRD label: "true" means instances participate in backup/restore
74-
BackupCategoryLabel = "openstack.org/backup-category" // CRD & instance label: "controlplane" or "dataplane"
75-
BackupRestoreOrderLabel = "openstack.org/backup-restore-order" // CRD & instance label: "00"-"60"
73+
BackupRestoreLabel = "backup.openstack.org/restore" // CRD label: "true" means instances participate in backup/restore
74+
BackupCategoryLabel = "backup.openstack.org/category" // CRD & instance label: "controlplane" or "dataplane"
75+
BackupRestoreOrderLabel = "backup.openstack.org/restore-order" // CRD & instance label: "00"-"60"
7676
)
7777

7878
// GetRestoreLabels returns a map with backup/restore labels for CR instances
@@ -132,9 +132,9 @@ func BuildCRDLabelCache(ctx context.Context, c client.Client) (CRDLabelCache, er
132132
Add labels to CRD metadata using kubebuilder annotations on Go type definitions:
133133

134134
```go
135-
// +kubebuilder:metadata:labels=openstack.org/backup-restore=true
136-
// +kubebuilder:metadata:labels=openstack.org/backup-category=controlplane
137-
// +kubebuilder:metadata:labels=openstack.org/backup-restore-order=30
135+
// +kubebuilder:metadata:labels=backup.openstack.org/restore=true
136+
// +kubebuilder:metadata:labels=backup.openstack.org/category=controlplane
137+
// +kubebuilder:metadata:labels=backup.openstack.org/restore-order=30
138138
type OpenStackControlPlane struct {
139139
```
140140
@@ -204,14 +204,14 @@ After modifying type definitions, run `make generate manifests` to update genera
204204
205205
```bash
206206
# List all CRDs with backup-restore labels
207-
oc get crd -l openstack.org/backup-restore=true
207+
oc get crd -l backup.openstack.org/restore=true
208208

209209
# Check specific CRD
210210
oc get crd openstackcontrolplanes.core.openstack.org -o jsonpath='{.metadata.labels}'
211211

212212
# Filter by category
213-
oc get crd -l openstack.org/backup-restore=true -l openstack.org/backup-category=controlplane
214-
oc get crd -l openstack.org/backup-restore=true -l openstack.org/backup-category=dataplane
213+
oc get crd -l backup.openstack.org/restore=true -l backup.openstack.org/category=controlplane
214+
oc get crd -l backup.openstack.org/restore=true -l backup.openstack.org/category=dataplane
215215
```
216216
217217
## Phase 3: OpenStackBackupConfig Controller
@@ -353,13 +353,13 @@ MariaDB operator labels database password secrets with restore order 10.
353353
354354
We use two separate OADP backups:
355355
356-
1. **backup-openstack-pvcs** - Contains ONLY PVCs with `openstack.org/backup: "true"` label
356+
1. **backup-openstack-pvcs** - Contains ONLY PVCs with `backup.openstack.org/backup: "true"` label
357357
- Filtering done at backup time via labelSelector
358358
- Uses CSI volume snapshots
359359
360360
2. **backup-openstack-resources** - Contains everything EXCEPT PVCs
361361
- No filtering at backup time (backs up all resources)
362-
- Restore uses labelSelector to filter by `openstack.org/backup-restore-order`
362+
- Restore uses labelSelector to filter by `backup.openstack.org/restore-order`
363363
364364
### Restore Order Summary
365365
@@ -393,8 +393,8 @@ spec:
393393
- openstack
394394
labelSelector:
395395
matchLabels:
396-
openstack.org/backup-restore: "true"
397-
openstack.org/backup-restore-order: "20"
396+
backup.openstack.org/restore: "true"
397+
backup.openstack.org/restore-order: "20"
398398
resourceModifier:
399399
kind: ConfigMap
400400
name: openstack-restore-resource-modifiers
@@ -428,7 +428,7 @@ ansible-playbook docs/dev/backup-restore/restore/restore-openstack.yaml \
428428
429429
```bash
430430
# List all CRDs with backup-restore labels
431-
oc get crd -l openstack.org/backup-restore=true
431+
oc get crd -l backup.openstack.org/restore=true
432432

433433
# Verify specific CRD labels
434434
oc get crd openstackcontrolplanes.core.openstack.org -o jsonpath='{.metadata.labels}'
@@ -452,10 +452,10 @@ EOF
452452
oc get openstackbackupconfig backup-config -n openstack
453453

454454
# Verify user-provided secrets are labeled
455-
oc get secret -l openstack.org/backup-restore=true -n openstack
455+
oc get secret -l backup.openstack.org/restore=true -n openstack
456456

457457
# Verify CR instances are labeled
458-
oc get openstackcontrolplane -l openstack.org/backup-restore=true -n openstack
458+
oc get openstackcontrolplane -l backup.openstack.org/restore=true -n openstack
459459
```
460460
461461
### Backup Testing
@@ -500,7 +500,7 @@ oc wait --for=jsonpath='{.status.phase}'=Completed restore/openstack-restore-00-
500500
501501
### CRD Label Cache Issues
502502
503-
- Verify CRD labels: `oc get crd -l openstack.org/backup-restore=true`
503+
- Verify CRD labels: `oc get crd -l backup.openstack.org/restore=true`
504504
- Cache is built lazily on first reconciliation; restart operator to rebuild
505505
- After `make generate manifests`, apply updated CRDs: `oc apply -f config/crd/bases/`
506506

docs/dev/backup-restore/backup-restore-pvc-enhancement.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Enhance the backup/restore system to serialize OpenStack CRs, Secrets, and Confi
88

99
The POC implementation uses a two-backup approach:
1010

11-
1. **openstack-backup-pvcs**: CSI snapshots of PVCs labeled with `openstack.org/backup: "true"`
11+
1. **openstack-backup-pvcs**: CSI snapshots of PVCs labeled with `backup.openstack.org/backup: "true"`
1212
- Glance image storage PVCs
1313
- MariaDB GaleraBackup PVCs
1414

@@ -53,7 +53,7 @@ Replace the Velero object storage backup of resources with a backup controller t
5353
│ │ /metadata.json │
5454
│ │ │
5555
│ └──> Labels backup PVC with │
56-
│ openstack.org/backup: "true" │
56+
backup.openstack.org/backup: "true" │
5757
│ │
5858
│ OADP Backup (single) │
5959
│ └──> CSI snapshots of ALL labeled PVCs │
@@ -385,7 +385,7 @@ spec:
385385
# Only backup labeled PVCs
386386
labelSelector:
387387
matchLabels:
388-
openstack.org/backup: "true"
388+
backup.openstack.org/backup: "true"
389389

390390
# Use CSI snapshots for all PVCs
391391
snapshotVolumes: true
@@ -439,7 +439,7 @@ spec:
439439
### Backup PVC Lifecycle
440440
441441
- PVC should be created by backup controller
442-
- Labeled with `openstack.org/backup: "true"` to be included in OADP backup
442+
- Labeled with `backup.openstack.org/backup: "true"` to be included in OADP backup
443443
- Should persist between backups (accumulate backup history)
444444
- Cleanup policy: keep last N backups, or retention period
445445

docs/dev/backup-restore/backup/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ We use a two-backup strategy:
88

99
1. **backup-openstack-pvcs.yaml** - PVCs only (with CSI snapshots, local only)
1010
- Filters at backup time using `labelSelector`
11-
- Only includes PVCs labeled with `openstack.org/backup: "true"`
11+
- Only includes PVCs labeled with `backup.openstack.org/backup: "true"`
1212
- Includes: Glance image storage PVCs, GaleraBackup PVCs
1313

1414
1. **backup-openstack-pvcs-datamover.yaml** - PVCs with Data Mover (uploads to S3/MinIO)
@@ -47,7 +47,7 @@ ansible-playbook docs/dev/backup-restore/backup/backup-openstack.yaml
4747

4848
The playbook runs three steps:
4949
1. **Trigger Galera DB dumps** — creates jobs from GaleraBackup cronjobs
50-
2. **OADP PVC backup** — CSI snapshots of PVCs labeled with `openstack.org/backup=true`
50+
2. **OADP PVC backup** — CSI snapshots of PVCs labeled with `backup.openstack.org/backup=true`
5151
3. **OADP resources backup** — all resources in the namespace except PVCs
5252

5353
PVC backup labels are set automatically by service operators (glance-operator, mariadb-operator).
@@ -89,7 +89,7 @@ oc describe backup openstack-backup-pvcs -n openshift-adp
8989

9090
- Glance local PVCs (image storage)
9191
- GaleraBackup PVCs (database backups)
92-
- Any other PVCs labeled with `openstack.org/backup: "true"`
92+
- Any other PVCs labeled with `backup.openstack.org/backup: "true"`
9393

9494
### backup-openstack-resources
9595

docs/dev/backup-restore/backup/backup-openstack-pvcs-datamover.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# OpenStack PVC Backup with Data Mover
3-
# Backs up PVCs labeled with openstack.org/backup=true and uploads
3+
# Backs up PVCs labeled with backup.openstack.org/backup=true and uploads
44
# CSI snapshot data to the BackupStorageLocation (S3/MinIO) via Kopia.
55
# This allows restore even after total cluster loss.
66
#
@@ -23,7 +23,7 @@ spec:
2323
# For PVCs, Velero automatically includes their bound PVs
2424
labelSelector:
2525
matchLabels:
26-
openstack.org/backup: "true"
26+
backup.openstack.org/backup: "true"
2727

2828
# Use CSI snapshots for PVCs
2929
snapshotVolumes: true

docs/dev/backup-restore/backup/backup-openstack-pvcs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# OpenStack PVC Backup
3-
# Backs up only PVCs (and their bound PVs) labeled with openstack.org/backup=true
3+
# Backs up only PVCs (and their bound PVs) labeled with backup.openstack.org/backup=true
44
# These include: Glance image storage PVCs, GaleraBackup PVCs
55
#
66
# Note: Velero automatically includes the PV bound to each PVC - no need to label PVs
@@ -17,7 +17,7 @@ spec:
1717
# For PVCs, Velero automatically includes their bound PVs
1818
labelSelector:
1919
matchLabels:
20-
openstack.org/backup: "true"
20+
backup.openstack.org/backup: "true"
2121

2222
# Use CSI snapshots for PVCs
2323
snapshotVolumes: true

docs/dev/backup-restore/backup/backup-openstack.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# 2. OADP PVC backup (CSI snapshots of labeled PVCs)
77
# 3. OADP resources backup (CRs, Secrets, ConfigMaps, NADs, etc.)
88
#
9-
# PVC backup labels (openstack.org/backup=true) are set automatically
9+
# PVC backup labels (backup.openstack.org/backup=true) are set automatically
1010
# by the service operators (glance-operator, mariadb-operator, etc.).
1111
#
1212
# Prerequisites:
@@ -108,7 +108,7 @@
108108

109109
- name: List PVCs marked for backup
110110
ansible.builtin.shell: |
111-
oc get pvc -n {{ openstack_namespace }} -l openstack.org/backup=true \
111+
oc get pvc -n {{ openstack_namespace }} -l backup.openstack.org/backup=true \
112112
-o custom-columns=NAME:.metadata.name,SIZE:.spec.resources.requests.storage,SERVICE:.metadata.labels.service --no-headers
113113
register: labeled_pvcs
114114
changed_when: false
@@ -121,7 +121,7 @@
121121

122122
- name: Warn if no PVCs labeled
123123
ansible.builtin.debug:
124-
msg: "WARNING: No PVCs found with openstack.org/backup=true label"
124+
msg: "WARNING: No PVCs found with backup.openstack.org/backup=true label"
125125
when: labeled_pvcs.stdout_lines | default([]) | length == 0
126126

127127
- name: Create OADP PVC backup
@@ -137,7 +137,7 @@
137137
- {{ openstack_namespace }}
138138
labelSelector:
139139
matchLabels:
140-
openstack.org/backup: "true"
140+
backup.openstack.org/backup: "true"
141141
snapshotVolumes: true
142142
snapshotMoveData: {{ snapshot_move_data | lower }}
143143
defaultVolumesToFsBackup: false

docs/dev/backup-restore/disaster-recovery-guide.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ Node worker-5: # Different node!
10341034
10351035
All your work is used:
10361036
- ✅ CRD labels → Velero uses these to identify resources
1037-
- ✅ PVC labels (`openstack.org/backup: "true"`) → Identifies which PVCs to snapshot
1037+
- ✅ PVC labels (`backup.openstack.org/backup: "true"`) → Identifies which PVCs to snapshot
10381038
- ✅ CR instance labels → Used for restore ordering
10391039
- ✅ Backup/Restore CRs → Just add `snapshotMoveData: true`
10401040
@@ -1295,7 +1295,7 @@ spec:
12951295
12961296
labelSelector:
12971297
matchLabels:
1298-
openstack.org/backup: "true"
1298+
backup.openstack.org/backup: "true"
12991299
13001300
snapshotVolumes: true # ← Already have this
13011301
@@ -1314,7 +1314,7 @@ spec:
13141314
13151315
labelSelector:
13161316
matchLabels:
1317-
openstack.org/backup: "true"
1317+
backup.openstack.org/backup: "true"
13181318
13191319
snapshotVolumes: true
13201320
snapshotMoveData: true # ← ADD THIS LINE for DR!
@@ -1573,7 +1573,7 @@ spec:
15731573
# Only backup labeled resources
15741574
labelSelector:
15751575
matchLabels:
1576-
openstack.org/backup-restore: "true"
1576+
backup.openstack.org/restore: "true"
15771577
15781578
# Backup PVCs to object storage
15791579
defaultVolumesToFsBackup: true
@@ -1619,7 +1619,7 @@ spec:
16191619
16201620
labelSelector:
16211621
matchLabels:
1622-
openstack.org/backup: "true"
1622+
backup.openstack.org/backup: "true"
16231623
16241624
# Use Restic instead of CSI snapshots
16251625
defaultVolumesToFsBackup: true
@@ -1882,8 +1882,8 @@ spec:
18821882

18831883
labelSelector:
18841884
matchLabels:
1885-
openstack.org/backup-restore: "true"
1886-
openstack.org/backup-restore-order: "10"
1885+
backup.openstack.org/restore: "true"
1886+
backup.openstack.org/restore-order: "10"
18871887

18881888
resourceModifier:
18891889
kind: ConfigMap
@@ -2034,8 +2034,8 @@ spec:
20342034

20352035
labelSelector:
20362036
matchLabels:
2037-
openstack.org/backup-restore: "true"
2038-
openstack.org/backup-restore-order: "60"
2037+
backup.openstack.org/restore: "true"
2038+
backup.openstack.org/restore-order: "60"
20392039

20402040
resourceModifier:
20412041
kind: ConfigMap

docs/dev/backup-restore/restore/01-restore-order-00-pvcs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Must be restored first before other resources
55
#
66
# Note: No labelSelector needed - the backup (openstack-backup-pvcs) already
7-
# filtered to only include PVCs with openstack.org/backup=true label.
7+
# filtered to only include PVCs with backup.openstack.org/backup=true label.
88
#
99
# Prerequisite: Create the resource modifier ConfigMap first:
1010
# oc apply -f 00-resource-modifiers-configmap.yaml

docs/dev/backup-restore/restore/02-restore-order-10-foundation.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ spec:
2020
# Only restore resources with backup-restore label and order 10
2121
labelSelector:
2222
matchLabels:
23-
openstack.org/backup-restore: "true"
24-
openstack.org/backup-restore-order: "10"
23+
backup.openstack.org/restore: "true"
24+
backup.openstack.org/restore-order: "10"
2525

2626
# Remove last-applied-configuration via ConfigMap-based resource modifiers
2727
resourceModifier:

0 commit comments

Comments
 (0)