You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Aiven Operator provides a deletion policy annotation that prevents deletion of Aiven resources when Kubernetes resources are removed. This feature works with all Aiven operator resources.
4
+
5
+
## Overview
6
+
7
+
By default, when you delete an Aiven operator resource (like `PostgreSQL`, `KafkaTopic`, `ServiceUser`, etc.), the operator deletes both the Kubernetes resource and the corresponding Aiven service. The `controllers.aiven.io/deletion-policy: Orphan` annotation allows you to override this behavior and preserve the Aiven resource while removing only the Kubernetes resource.
8
+
9
+
## Using the Deletion Policy
10
+
11
+
### Step 1: Add the Annotation
12
+
13
+
Add the deletion policy annotation to the resource you want to protect:
14
+
15
+
```yaml
16
+
apiVersion: aiven.io/v1alpha1
17
+
kind: PostgreSQL # or any other Aiven resource
18
+
metadata:
19
+
name: my-database
20
+
namespace: my-namespace
21
+
annotations:
22
+
controllers.aiven.io/deletion-policy: Orphan
23
+
spec:
24
+
# ... existing configuration
25
+
```
26
+
27
+
### Step 2: Delete the Kubernetes Resource
28
+
29
+
Now you can safely delete the Kubernetes resource:
0 commit comments