Skip to content

Commit b8a5638

Browse files
gbartolinimnencia
authored andcommitted
docs: review the usage page (flipped the sections)
Signed-off-by: Gabriele Bartolini <[email protected]>
1 parent 094f771 commit b8a5638

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

web/docs/usage.md

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -81,34 +81,13 @@ This configuration enables both WAL archiving and data directory backups.
8181

8282
## Performing a Base Backup
8383

84-
Once WAL archiving is enabled, the cluster is ready for backups.
84+
Once WAL archiving is enabled, the cluster is ready for backups. Backups can be
85+
created either declaratively (with YAML manifests) or imperatively (with the
86+
`cnpg` plugin).
8587

86-
### Using kubectl-cnpg plugin
88+
### Declarative approach (YAML manifest)
8789

88-
The quickest way to create an on-demand backup is using the kubectl-cnpg plugin:
89-
90-
```bash
91-
kubectl cnpg backup -n <namespace> <cluster-name> \
92-
--method=plugin \
93-
--plugin-name=barman-cloud.cloudnative-pg.io
94-
```
95-
96-
:::note Migration from in-tree backup
97-
If you're migrating from the in-tree backup system, note that the command has changed from:
98-
```bash
99-
# Old command (in-tree backup)
100-
kubectl cnpg backup -n <namespace> <cluster-name> --method=barmanObjectStore
101-
```
102-
to:
103-
```bash
104-
# New command (plugin backup)
105-
kubectl cnpg backup -n <namespace> <cluster-name> --method=plugin --plugin-name=barman-cloud.cloudnative-pg.io
106-
```
107-
:::
108-
109-
### Using YAML manifests
110-
111-
Alternatively, you can create a backup using a YAML manifest:
90+
Create a backup resource by applying a YAML manifest:
11291

11392
```yaml
11493
apiVersion: postgresql.cnpg.io/v1
@@ -123,8 +102,28 @@ spec:
123102
name: barman-cloud.cloudnative-pg.io
124103
```
125104

126-
:::note
127-
You can apply the same concept to the `ScheduledBackup` resource.
105+
### Imperative approach (using the `cnpg` plugin)
106+
107+
The quickest way to trigger an on-demand backup is with the `cnpg` plugin:
108+
109+
```bash
110+
kubectl cnpg backup -n <namespace> <cluster-name> \
111+
--method=plugin \
112+
--plugin-name=barman-cloud.cloudnative-pg.io
113+
```
114+
115+
:::note Migration from in-tree backups
116+
If you are migrating from the in-tree backup system, note the change in syntax:
117+
118+
```bash
119+
# Old command (in-tree backup)
120+
kubectl cnpg backup -n <namespace> <cluster-name> --method=barmanObjectStore
121+
122+
# New command (plugin-based backup)
123+
kubectl cnpg backup -n <namespace> <cluster-name> \
124+
--method=plugin \
125+
--plugin-name=barman-cloud.cloudnative-pg.io
126+
```
128127
:::
129128

130129
## Restoring a Cluster

0 commit comments

Comments
 (0)