Skip to content

Commit 713593d

Browse files
Annamichaelklishin
Anna
authored andcommitted
deletionPolicy described
1 parent 2dcaa07 commit 713593d

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

kubernetes/operator/using-topology-operator.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,28 @@ Properties that cannot be updated is documented in the [Messaging Topology Opera
519519

520520
Deleting custom resources will delete the corresponding resources in the RabbitMQ cluster. Messaging Topology Operator sets kubernetes
521521
[finalizers](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#finalizers) on all custom
522-
resources. If the object has already been deleted in the RabbitMQ cluster, or the RabbitMQ cluster has been deleted, Messaging Topology
522+
resources.
523+
524+
Starting from Messaging Topology Operator version `1.17`, you can control the deletion behavior for `Federation`, `Queue`, `Shovel`, and `Vhost` resources using the `deletionPolicy` field.
525+
This field determines what happens to the corresponding resource in RabbitMQ cluster when the custom resource is deleted. The deletionPolicy can be set to:
526+
* `delete`: The resource will be removed from RabbitMQ cluster when the custom resource deleted (default)
527+
* `retain`: The resource will remain in RabbitMQ cluster when the custom resource deleted
528+
529+
530+
Example using Queue resource:
531+
```yaml
532+
apiVersion: rabbitmq.com/v1beta1
533+
kind: Queue
534+
metadata:
535+
name: example-queue
536+
spec:
537+
name: example-queue
538+
rabbitmqClusterReference:
539+
name: example-rabbitmq
540+
deletionPolicy: retain # Queue will remain in RabbitMQ cluster when this k8s resource is deleted
541+
```
542+
543+
If the object has already been deleted in the RabbitMQ cluster, or the RabbitMQ cluster has been deleted, Messaging Topology
523544
Operator will delete the custom resource without trying to delete the RabbitMQ object.
524545

525546
## Limitations {#limitations}

0 commit comments

Comments
 (0)