Skip to content

Commit ef4d26d

Browse files
jbattiatomnencia
authored andcommitted
docs(rbac): review procedure
Signed-off-by: Jonathan Battiato <[email protected]>
1 parent 78b6504 commit ef4d26d

File tree

2 files changed

+22
-285
lines changed

2 files changed

+22
-285
lines changed

web/docs/resource-name-migration.md

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@ sidebar_position: 41
77
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
88

99
:::warning
10-
Before running the migration script or applying the manifest, please:
11-
1. **Review the complete manifest** at [migration-rbac.yaml](/migration-rbac.yaml) to understand what changes will be made
10+
Before proceeding with the migration process, please:
11+
1. **Read this guide in its entirety** to understand what changes will be made
1212
2. **Test in a non-production environment** first if possible
1313
3. **Ensure you have proper backups** of your cluster configuration
1414

15-
This migration will delete old RBAC resources and create new ones. While the operation is designed to be safe, you should review and understand the changes before proceeding. The maintainers of this project are not responsible for any issues that may arise during migration.
15+
This migration will delete old RBAC resources only after the plugin-barman-cloud upgrade. While the operation is
16+
designed to be safe, you should review and understand the changes before proceeding. The maintainers of this project
17+
are not responsible for any issues that may arise during migration.
1618

1719
**Note:** This guide assumes you are using the default `cnpg-system` namespace.
1820
:::
1921

2022
## Overview
2123

22-
Starting from version 0.8.0, the plugin-barman-cloud deployment manifests use more specific, prefixed resource names to avoid conflicts with other components deployed in the same Kubernetes cluster.
24+
Starting from version **0.8.0**, the plugin-barman-cloud deployment manifests use more specific, prefixed resource names
25+
to avoid conflicts with other components deployed in the same Kubernetes cluster.
2326

2427
## What Changed
2528

@@ -44,14 +47,22 @@ The following resources have been renamed to use proper prefixes:
4447

4548
## Why This Change?
4649

47-
Using generic names for cluster-wide resources is discouraged as they may conflict with other components deployed in the same cluster. The new names make it clear that these resources belong to the barman-cloud plugin and help avoid naming collisions.
50+
Using generic names for cluster-wide resources is discouraged as they may conflict with other components deployed in
51+
the same cluster. The new names make it clear that these resources belong to the barman-cloud plugin and help avoid
52+
naming collisions.
4853

4954
## Migration Instructions
5055

51-
The migration process is straightforward and can be completed with a few kubectl commands.
56+
This three steps migration process is straightforward and can be completed with a few kubectl commands.
57+
58+
### Step 1: Upgrade plugin-barman-cloud
59+
60+
Please refer to the [Installation](installation.mdx) section to deploy the new plugin-barman-cloud release.
61+
62+
### Step 2: Delete Old Cluster-scoped Resources
5263

5364
:::danger Verify Resources Before Deletion
54-
**IMPORTANT**: The old resource names are generic and could potentially belong to other components in your cluster.
65+
**IMPORTANT**: The old resource names are generic and could potentially belong to other components in your cluster.
5566

5667
**Before deleting each resource, verify it belongs to the barman plugin by checking:**
5768
- For `objectstore-*` roles: Look for `barmancloud.cnpg.io` in the API groups
@@ -60,15 +71,14 @@ The migration process is straightforward and can be completed with a few kubectl
6071

6172
If a resource doesn't have these indicators, **DO NOT DELETE IT** as it may belong to another application.
6273

63-
In Step 1 below, carefully review the output of each verification command before proceeding with the delete.
74+
Carefully review the output of each verification command before proceeding with the `delete`.
6475
:::
6576

6677
:::tip Dry Run First
67-
You can add `--dry-run=client` to any `kubectl delete` command to preview what would be deleted without actually removing anything.
78+
You can add `--dry-run=client` to any `kubectl delete` command to preview what would be deleted without actually
79+
removing anything.
6880
:::
6981

70-
### Step 1: Delete Old Cluster-scoped Resources
71-
7282
**Only proceed if you've verified these resources belong to the barman plugin (see warning above).**
7383

7484
For each resource below, first verify it belongs to barman, then delete it:
@@ -121,7 +131,7 @@ If you're unsure, it's safer to leave it and let the new `barman-plugin-metrics-
121131

122132
If any resource is not found during the `describe` command, that's okay - it means it was never created or already deleted. Simply skip the delete command for that resource.
123133

124-
### Step 2: Delete Old Namespace-scoped Resources
134+
### Step 3: Delete Old Namespace-scoped Resources
125135

126136
Delete the old namespace-scoped resources in the `cnpg-system` namespace:
127137

@@ -133,34 +143,8 @@ kubectl delete rolebinding leader-election-rolebinding -n cnpg-system
133143

134144
If any resource is not found, that's okay - it means it was never created or already deleted.
135145

136-
### Step 3: Apply the New RBAC Manifest
137-
138-
Download and apply the new manifest with the updated resource names:
139-
140-
```bash
141-
kubectl apply -f https://cloudnative-pg.io/plugin-barman-cloud/migration-rbac.yaml
142-
```
143-
144-
Alternatively, you can download the [migration-rbac.yaml](/migration-rbac.yaml) file and review it locally before applying:
145-
146-
```bash
147-
# Download the file
148-
curl -O https://cloudnative-pg.io/plugin-barman-cloud/migration-rbac.yaml
149-
150-
# Review it
151-
cat migration-rbac.yaml
152-
153-
# Apply it
154-
kubectl apply -f migration-rbac.yaml
155-
```
156-
157-
:::info
158-
The new manifest will create all RBAC resources with the `barman-plugin-` prefix in the `cnpg-system` namespace. You can review the complete YAML at [migration-rbac.yaml](/migration-rbac.yaml).
159-
:::
160-
161146
## Impact
162147

163-
- **Downtime:** The migration requires a brief interruption as the old resources are deleted and new ones are created. The plugin controller may need to restart.
164148
- **Permissions:** If you have custom RBAC rules or tools that reference the old resource names, they will need to be updated.
165149
- **External Users:** If end users have been granted the `objectstore-viewer-role` or `objectstore-editor-role`, they will need to be re-granted the new role names (`barman-plugin-objectstore-viewer-role` and `barman-plugin-objectstore-editor-role`).
166150

web/static/migration-rbac.yaml

Lines changed: 0 additions & 247 deletions
This file was deleted.

0 commit comments

Comments
 (0)