Skip to content

Add RabbitMQ federation support for multi-region deployments#533

Draft
xek wants to merge 2 commits intoopenstack-k8s-operators:mainfrom
xek:rabbitmq-federation
Draft

Add RabbitMQ federation support for multi-region deployments#533
xek wants to merge 2 commits intoopenstack-k8s-operators:mainfrom
xek:rabbitmq-federation

Conversation

@xek
Copy link
Contributor

@xek xek commented Feb 12, 2026

Summary

  • Adds RabbitMQFederation CRD and controller to configure RabbitMQ exchange federation via the Management HTTP API
  • Enables replicating messages (e.g. Keystone notifications) between RabbitMQ clusters in different regions, so services like barbican-keystone-listener can consume them from their local broker
  • Extends the Management API client with federation upstream methods (max-hops, prefetch-count, reconnect-delay per the RabbitMQ federation reference)

The upstream connection can be specified either by referencing a RabbitmqCluster CR in the same namespace (for testing) or via a Secret containing the AMQP URI (for cross-region deployments).

The controller:

  • Creates a federation-upstream parameter on the local cluster
  • Creates a policy matching the configured exchange pattern (apply-to: exchanges)
  • Cleans up both on deletion

Closes: OSPRH-25296
Assisted-by: Claude 4.6 Opus (Anthropic AI)

Test plan

  • Unit/functional tests for the new controller
  • Deploy two RabbitMQ clusters, configure federation, verify exchange replication
  • Test cross-region mode with upstreamSecretRef
  • Verify cleanup on CR deletion

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 12, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 12, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: xek
Once this PR has been reviewed and has the lgtm label, please assign stuggi for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

xek added a commit to xek/openstack-operator that referenced this pull request Feb 12, 2026
Extend the RabbitmqSection in OpenStackControlPlane with an optional
Federation map that allows configuring RabbitMQ exchange federation
between clusters in multi-region deployments.

Each federation entry creates a RabbitMQFederation CR (from
infra-operator) that configures the local RabbitMQ cluster to
replicate matching exchanges from a remote upstream. This enables
services like barbican-keystone-listener in regionTwo to consume
Keystone notifications from their local broker, with federation
handling replication transparently.

Includes a sample configuration showing how to set up federation
for Keystone notifications in a two-region deployment.

Depends-On: openstack-k8s-operators/infra-operator#533
Closes: OSPRH-25296
Co-authored-by: Cursor <cursoragent@cursor.com>
@xek xek force-pushed the rabbitmq-federation branch from 2fe6d7d to e3830a6 Compare February 12, 2026 11:20
xek added a commit to xek/openstack-operator that referenced this pull request Feb 12, 2026
Extend the RabbitmqSection in OpenStackControlPlane with an optional
Federation map that allows configuring RabbitMQ exchange federation
between clusters in multi-region deployments.

Each federation entry creates a RabbitMQFederation CR (from
infra-operator) that configures the local RabbitMQ cluster to
replicate matching exchanges from a remote upstream. This enables
services like barbican-keystone-listener in regionTwo to consume
Keystone notifications from their local broker, with federation
handling replication transparently.

Includes a sample configuration showing how to set up federation
for Keystone notifications in a two-region deployment.

Depends-On: openstack-k8s-operators/infra-operator#533
Closes: OSPRH-25296
Assisted-by: Claude 4.6 Opus (Anthropic AI)
Co-authored-by: Cursor <cursoragent@cursor.com>
@xek xek force-pushed the rabbitmq-federation branch from c4ada72 to e1c424c Compare February 12, 2026 13:08
Introduces the RabbitMQFederation CRD and controller for configuring
RabbitMQ exchange/queue federation between clusters. Supports both
same-namespace federation (via UpstreamClusterName) and cross-region
federation (via UpstreamSecretRef with AMQP URIs).

Key features:
- RabbitMQFederation CRD with comprehensive spec (ack mode, expires,
  max hops, prefetch count, reconnect delay, trust user ID, policy
  pattern, queue type, priority, etc.)
- Controller with full lifecycle management: upstream creation, policy
  creation, plugin auto-enablement, finalizer-based cleanup
- Upstream cluster protection via per-federation finalizers on the
  upstream RabbitMq CR
- Webhook validation (immutable fields, mutual exclusivity, upstream
  existence checks, regex validation)
- Management API client extensions for federation upstreams and policies
- Functional tests for controller and webhook

Co-authored-by: Luca Miccini <lmiccini@redhat.com>
Assisted-by: Claude 4.6 Opus
@xek xek force-pushed the rabbitmq-federation branch 5 times, most recently from 8574146 to d3523b2 Compare February 12, 2026 15:45
xek added a commit to xek/openstack-operator that referenced this pull request Feb 12, 2026
Extend the RabbitmqSection in OpenStackControlPlane with an optional
Federation map that allows configuring RabbitMQ exchange federation
between clusters in multi-region deployments.

Each federation entry creates a RabbitMQFederation CR (from
infra-operator) that configures the local RabbitMQ cluster to
replicate matching exchanges from a remote upstream. This enables
services like barbican-keystone-listener in regionTwo to consume
Keystone notifications from their local broker, with federation
handling replication transparently.

Includes a sample configuration showing how to set up federation
for Keystone notifications in a two-region deployment.

Depends-On: openstack-k8s-operators/infra-operator#533
Closes: OSPRH-25296
Assisted-by: Claude 4.6 Opus
Co-authored-by: Cursor <cursoragent@cursor.com>
When a RabbitMQFederation is reconciled, the controller now ensures
that rabbitmq_federation and rabbitmq_federation_management plugins
are enabled on the target RabbitmqCluster CR's additionalPlugins.
When the plugins are first added, reconciliation is requeued for 30s
to allow RabbitMQ to load them before configuring upstreams/policies.

On deletion, if no other RabbitMQFederation CRs reference the same
cluster, the federation plugins are removed from additionalPlugins.
Plugin removal uses the Kubernetes API and is always attempted even
when the RabbitMQ management API is unavailable. This ensures a
clean state.

Adds functional tests for plugin addition, removal, preservation
when multiple federations exist, and status condition initialization.

Assisted-by: Claude 4.6 Opus
Co-authored-by: Cursor <cursoragent@cursor.com>
@xek xek force-pushed the rabbitmq-federation branch from d3523b2 to 638f18b Compare February 12, 2026 17:39
xek added a commit to xek/openstack-operator that referenced this pull request Feb 12, 2026
Extend the RabbitmqSection in OpenStackControlPlane with an optional
Federation map that allows configuring RabbitMQ exchange federation
between clusters in multi-region deployments.

Each federation entry creates a RabbitMQFederation CR (from
infra-operator) that configures the local RabbitMQ cluster to
replicate matching exchanges from a remote upstream. This enables
services like barbican-keystone-listener in regionTwo to consume
Keystone notifications from their local broker, with federation
handling replication transparently.

Includes a sample configuration showing how to set up federation
for Keystone notifications in a two-region deployment.

Depends-On: openstack-k8s-operators/infra-operator#533
Closes: OSPRH-25296
Assisted-by: Claude 4.6 Opus
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant