In this policy-demo.yaml, we can edit the max-length-bytes to 2000000 without recreation of the policy.
apiVersion: rabbitmq.com/v1beta1
kind: Policy
metadata:
name: policy-example
namespace: rabbitmq-system
spec:
name: policy-demo # name of the policy
vhost: "/" # default to '/' if not provided
pattern: ".*" # regex used to match queues and exchanges
applyTo: "queues" # set to 'queues', 'exchanges', or 'all'
definition: # policy definition
expires: 1800000
max-length-bytes: 2000000
rabbitmqClusterReference:
name: upstream-rabbit
All we need to do is to apply this yaml file.
# kubectl apply -f policy-demo.yaml
policy.rabbitmq.com/policy-example created
#