RabbitMQ for Kubernetes: Modify the policy with the yaml file
search cancel

RabbitMQ for Kubernetes: Modify the policy with the yaml file

book

Article ID: 293211

calendar_today

Updated On:

Products

VMware RabbitMQ

Issue/Introduction

In some scenario,  the policy need to be modified without recreation. This KB article provided a guide on it.

Environment

Product Version: 1.3

Resolution

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
#


Snipaste_2023-08-15_14-26-23.jpg