Skip to content

Commit 76d0ff2

Browse files
authored
Merge pull request #198 from vshn/change/mariadb_db_note
Add note about manual user/db deletion
2 parents 4ad3b40 + e5bb918 commit 76d0ff2

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

docs/modules/ROOT/pages/vshn-managed/mariadb/usermanagement.adoc

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ If a user needs access to another user's database, it can be specified by the `d
1414
apiVersion: vshn.appcat.vshn.io/v1
1515
kind: VSHNMariaDB
1616
metadata:
17-
name: pgsql-app1-prod
17+
name: mariadb-app1-prod
1818
namespace: prod-app
1919
spec:
2020
parameters:
@@ -32,7 +32,7 @@ spec:
3232
name: my-secret
3333
namespace: app4
3434
writeConnectionSecretToRef:
35-
name: postgres-creds
35+
name: mariadb-creds
3636
----
3737
<1> Create a user and a database called app1, the user gets all privileges for the database
3838
<2> Create a user app2 and giving it all privileges to database app1
@@ -46,13 +46,19 @@ To remove a user and its database, you need to remove it from the `access` array
4646

4747
A user or database will be removed from the instance, if there are no more references in the `access` array.
4848

49+
[IMPORTANT]
50+
.Manual cleanup required
51+
====
52+
Removing users from the `access` array does NOT automatically delete the user, database, or grants from the MariaDB instance. These resources will remain in the database and must be manually deleted if no longer needed.
53+
====
54+
4955
.Example Deleting Users and Databases
5056
[source,yaml]
5157
----
5258
apiVersion: vshn.appcat.vshn.io/v1
5359
kind: VSHNMariaDB
5460
metadata:
55-
name: pgsql-app1-prod
61+
name: mariadb-app1-prod
5662
namespace: prod-app
5763
spec:
5864
parameters:
@@ -63,14 +69,22 @@ spec:
6369
database: app1 # <2>
6470
- user: app3 #<3>
6571
writeConnectionSecretToRef:
66-
name: postgres-creds
72+
name: mariadb-creds
6773
----
6874
<1> Removing this entry would remove the `app1` user and the grant giving it access to the app1 database. It will not remove the database, as it's still referenced by user app2.
6975
<2> Removing this entry would remove the user `app2` and the grants giving access to database app1. It will not remove the database app1, as it's still referenced by user `app1`
7076
<3> Removing this entry will remove the user `app3` and its database.
7177

72-
[IMPORTANT]
73-
.Non-reversible operation
78+
To manually clean up users, databases, and grants that are no longer managed:
79+
80+
. Remove the user and database from the claim
81+
. Connect to your MariaDB instance using the connection details
82+
. Revoke grants: `REVOKE ALL PRIVILEGES ON DATABASE databasename FROM username;`
83+
. Drop the user: `DROP USER username;`
84+
. Drop the database (if no longer needed): `DROP DATABASE databasename;`
85+
86+
[WARNING]
87+
.Manual deletion is irreversible
7488
====
75-
If you remove a user completely from the array, the user and the database will be removed from the instance!
89+
Manual deletion of users and databases is permanent and cannot be undone. Ensure you have backups and that the resources are truly no longer needed before deleting them. Renaming is also not possible. If a user is renamed, it will be treated as a new user, and the old user will remain in the database.
7690
====

docs/modules/ROOT/pages/vshn-managed/postgresql/usermanagement.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ spec:
7575

7676
To manually clean up users, databases, and grants that are no longer managed:
7777

78-
1. Connect to your PostgreSQL instance using the connection details
79-
2. Revoke grants: `REVOKE ALL PRIVILEGES ON DATABASE databasename FROM username;`
80-
3. Drop the user: `DROP USER username;`
81-
4. Drop the database (if no longer needed): `DROP DATABASE databasename;`
78+
. Remove the user and database from the claim
79+
. Connect to your PostgreSQL instance using the connection details
80+
. Revoke grants: `REVOKE ALL PRIVILEGES ON DATABASE databasename FROM username;`
81+
. Drop the user: `DROP USER username;`
82+
. Drop the database (if no longer needed): `DROP DATABASE databasename;`
8283

8384
[WARNING]
8485
.Manual deletion is irreversible

0 commit comments

Comments
 (0)