Skip to content

[#922] controlling resources deletion #2214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion kubernetes/operator/using-topology-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,28 @@ Properties that cannot be updated is documented in the [Messaging Topology Opera

Deleting custom resources will delete the corresponding resources in the RabbitMQ cluster. Messaging Topology Operator sets kubernetes
[finalizers](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#finalizers) on all custom
resources. If the object has already been deleted in the RabbitMQ cluster, or the RabbitMQ cluster has been deleted, Messaging Topology
resources.

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.
This field determines what happens to the corresponding resource in RabbitMQ cluster when the custom resource is deleted. The deletionPolicy can be set to:
* `delete`: The resource will be removed from RabbitMQ cluster when the custom resource deleted (default)
* `retain`: The resource will remain in RabbitMQ cluster when the custom resource deleted


Example using Queue resource:
```yaml
apiVersion: rabbitmq.com/v1beta1
kind: Queue
metadata:
name: example-queue
spec:
name: example-queue
rabbitmqClusterReference:
name: example-rabbitmq
deletionPolicy: retain # Queue will remain in RabbitMQ cluster when this k8s resource is deleted
```

If the object has already been deleted in the RabbitMQ cluster, or the RabbitMQ cluster has been deleted, Messaging Topology
Operator will delete the custom resource without trying to delete the RabbitMQ object.

## Limitations {#limitations}
Expand Down