Skip to content

Reference: Vhost CRD

A Vhost creates a virtual host in your RabbitMQ cluster. A virtual host groups queues, exchanges, bindings, policies and permissions, and isolates them from other virtual hosts in the same cluster. Other resources refer to the virtual host by its RabbitMQ name in spec.name, not by the metadata.name of the Vhost resource. To let a user access the virtual host, create a Permission.

  • apiVersion: rabbitmq.com/v1beta1
  • kind: Vhost
  • Scope: Namespaced

This page documents the RabbitMQ Messaging Topology Operator v1.20.6.

Example

apiVersion: rabbitmq.com/v1beta1
kind: Vhost
metadata:
  name: my-app-vhost
  namespace: your-application-namespace
spec:
  # The name of the virtual host inside RabbitMQ
  name: my-app-vhost
  defaultQueueType: quorum
  limits:
    connections: 100
    queues: 50
  rabbitmqClusterReference:
    name: my-rabbitmq-cluster

Specification (spec)

Field Type Description
name string Required. The name of the virtual host in RabbitMQ. You cannot change this field after creation.
rabbitmqClusterReference object Required. The RabbitMQ cluster to create the virtual host in. You cannot change this field after creation. See spec.rabbitmqClusterReference.
defaultQueueType string Optional. The queue type that RabbitMQ uses when a client declares a queue in this virtual host without a type. Allowed values: quorum, classic, stream. Requires RabbitMQ 3.11.12 or later.
limits object Optional. Limits for the virtual host. See spec.limits.
tags []string Optional. Metadata tags for the virtual host.
tracing boolean Optional. Enables message tracing (the firehose) for the virtual host. See RabbitMQ firehose tracer.
deletionPolicy string Optional. What happens to the virtual host in RabbitMQ when you delete the Vhost resource. delete removes the virtual host and everything in it. retain keeps it. Allowed values: delete, retain. Default: delete.

spec.rabbitmqClusterReference

Identifies the RabbitMQ cluster. Set either name or connectionSecret, but not both.

Field Type Description
name string Optional. The name of the RabbitmqCluster resource. Set this field or connectionSecret.
namespace string Optional. The namespace of the RabbitmqCluster. Defaults to the namespace of the Vhost. A cluster in another namespace accepts the reference only if its rabbitmq.com/topology-allowed-namespaces annotation lists your namespace.
connectionSecret object Optional. A reference (name) to a Secret with the keys uri, username and password for the management API of a RabbitMQ cluster that the RabbitMQ Cluster Operator does not manage. The Secret must have the label rabbitmq.com/topology-operator: "true". Set this field or name.

spec.limits

Field Type Description
connections integer Optional. The maximum number of concurrent client connections to the virtual host.
queues integer Optional. The maximum number of queues in the virtual host.

See RabbitMQ virtual host limits.

Status (status)

Field Type Description
conditions []object The Ready condition is True with reason SuccessfulCreateOrUpdate when the virtual host exists in RabbitMQ, and False with reason FailedCreateOrUpdate and an error message otherwise.
observedGeneration integer The most recent metadata.generation that the operator reconciled.

Platform Notes

  • We provision and manage the RabbitmqCluster resource in your namespace and give you its name. Set spec.rabbitmqClusterReference.name to that name. See Getting Started.

Further Reading