Reference: Permission CRD¶
A Permission grants a RabbitMQ user configure, write and read access to
resources in one virtual host. Each permission is a regular expression that
RabbitMQ matches against queue and exchange names. The User and the
Vhost must already exist.
apiVersion:rabbitmq.com/v1beta1kind:Permission- Scope: Namespaced
This page documents the RabbitMQ Messaging Topology Operator v1.20.6.
Example¶
apiVersion: rabbitmq.com/v1beta1
kind: Permission
metadata:
name: my-app-user-permissions
namespace: your-application-namespace
spec:
# The RabbitMQ name of the virtual host (spec.name of the Vhost)
vhost: my-app-vhost
# The metadata.name of a User in the same namespace
userReference:
name: my-app-user
permissions:
configure: "^tasks\\..*"
write: "^tasks\\..*"
read: "^tasks\\..*"
rabbitmqClusterReference:
name: my-rabbitmq-cluster
Specification (spec)¶
| Field | Type | Description |
|---|---|---|
vhost |
string |
Required. The RabbitMQ name of an existing virtual host. You cannot change this field after creation. |
userReference |
object |
Optional. A reference (name) to a User resource in the same namespace. Set this field or user, but not both. You cannot change this field after creation. |
user |
string |
Optional. The RabbitMQ username of an existing user. Use this for users that a User resource does not manage. Set this field or userReference, but not both. You cannot change this field after creation. |
permissions |
object |
Required. The permissions to grant. See spec.permissions. |
rabbitmqClusterReference |
object |
Required. The RabbitMQ cluster that holds both the user and the virtual host. You cannot change this field after creation. See spec.rabbitmqClusterReference. |
spec.permissions¶
Each field is a regular expression that RabbitMQ matches against resource
names. ".*" matches every resource, and "" matches none. An omitted field
grants no access.
| Field | Type | Description |
|---|---|---|
configure |
string |
Optional. Resources the user can create, delete or change, such as declaring a queue. |
write |
string |
Optional. Resources the user can publish to or bind to. |
read |
string |
Optional. Resources the user can consume from or bind from. |
See RabbitMQ access control for the exact operations each permission covers.
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 Permission. 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. |
Status (status)¶
| Field | Type | Description |
|---|---|---|
conditions |
[]object |
The Ready condition is True with reason SuccessfulCreateOrUpdate when RabbitMQ has the permissions, and False with reason FailedCreateOrUpdate and an error message otherwise. A missing user or virtual host shows up here. |
observedGeneration |
integer |
The most recent metadata.generation that the operator reconciled. |
Platform Notes¶
- We provision and manage the
RabbitmqClusterresource in your namespace and give you its name. Setspec.rabbitmqClusterReference.nameto that name. See Getting Started.