Skip to content

Commit

Permalink
Merge pull request #96 from vshn/update-delete-prot-docs
Browse files Browse the repository at this point in the history
Enhance deletion protection docs
  • Loading branch information
zugao authored Nov 16, 2023
2 parents 4b707e6 + de115f5 commit 16513eb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
43 changes: 43 additions & 0 deletions docs/modules/ROOT/pages/vshn-managed/postgresql/delete.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
= Delete a PostgreSQL service

== Delete non protected PostgreSQL instance

If you do not need your PostgreSQL service anymore, you can delete it in the same way as you would with any other object in your cluster:

[source,bash]
Expand All @@ -12,3 +14,44 @@ $ oc delete vshnpostgresqls.vshn.appcat.vshn.io my-postgres-example
====
If you delete the `VSHNPostgreSQL` object from the cluster, it will be deleted together with all of its data!
====

== Delete protected PostgreSQL instance

A PostgreSQL instance that is protected from deletion cannot be deleted right away.
First disable deletion protection then delete the instance.

. Disable deletion protection:
+
[source,bash]
----
$ oc edit vshnpostgresqls.vshn.appcat.vshn.io my-postgres-example
----
+
[source,yaml]
----
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNPostgreSQL
metadata:
name: pgsql-app1-prod
namespace: prod-app
spec:
parameters:
backup:
deletionProtection: false # <1>
writeConnectionSecretToRef:
name: postgres-creds
----
<1> Make sure the parameter is set to false

. Delete the instance
+
[source,bash]
----
$ oc delete vshnpostgresqls.vshn.appcat.vshn.io my-postgres-example
----
+
[IMPORTANT]
.Non-reversible operation
====
If you delete the `VSHNPostgreSQL` object from the cluster, it will be deleted together with all of its data!
====
11 changes: 10 additions & 1 deletion docs/modules/ROOT/pages/vshn-managed/postgresql/restore.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,13 @@ spec:
<2> The backup name you want to restore
<3> You need to specify that this is not a normal instance but a restored one
+
NOTE: The restore process is the same as ordering a new instance. The only difference is the backup information in `spec.parameters.restore` and `spec.compositionRef` objects.
[NOTE]
====
The restore process is the same as ordering a new instance.
The only difference is the backup information in `spec.parameters.restore` and `spec.compositionRef` objects.
====

== Deleting a Restored Instance

The deletion process of a restored instance is the same as for normal instance.
Check out xref:vshn-managed/postgresql/delete.adoc[this guide] how to delete a PostgreSQL instance.

0 comments on commit 16513eb

Please sign in to comment.