Commit 2f0db6d
Drop rabbitmq-cluster-operator dependency and manage RabbitMQ directly
Remove the dependency on the external rabbitmq-cluster-operator and have
the infra-operator manage RabbitMQ StatefulSets, Services, ConfigMaps,
and Secrets directly.
Core controller changes:
- Direct StatefulSet management with proper volume mounts, config
generation, and TLS support (both client and inter-node)
- Service creation for client (AMQP/AMQPS) and headless node discovery
- ConfigMap generation for server config, plugins, and config-data
- Secret management for default-user credentials and Erlang cookie
- PodDisruptionBudget for multi-replica deployments
- Fix stale ownerReferences in volumeClaimTemplates from adopted
StatefulSets (orphan-delete + recreate with annotation-based storage
class preservation)
- Set skipPreStopChecks label on pods before StatefulSet deletion
(storage wipe and CR deletion) to prevent 7-day termination hangs
Version upgrade workflow (3.x to 4.x):
- State machine with phases: DeletingResources -> WaitingForCluster
- Detects targetVersion changes and triggers storage wipe when crossing
major versions (required by RabbitMQ for 3.x -> 4.x upgrades)
- Sets wipeReason=VersionUpgrade in status to track upgrade progress
- Cleans up StatefulSet PVCs before recreating with new version image
- Tracks currentVersion in status after successful upgrade
Queue type migration (Mirrored to Quorum):
- Supports migrating from classic mirrored (ha-all policy) queues to
quorum queues via spec.queueType change
- Triggers storage wipe with wipeReason=QueueTypeMigration
- Manages ha-all policy lifecycle: applies for Mirrored (replicas > 1),
removes when transitioning away from Mirrored
- Defaulting webhook forces queueType from Mirrored to Quorum when
targetVersion is 4.x+, since mirrored queues are not supported in
RabbitMQ 4.x. This enables the openstack-operator to upgrade from
3.x (Mirrored) to 4.x and have the migration handled automatically
- Validation webhook rejects Mirrored+4.x as a safety net after
defaulting
AMQP proxy sidecar:
- Python-based TCP proxy injected as a sidecar container when
status.proxyRequired is true (after version upgrade or queue migration)
- Listens on port 5672 (plain) or 5671 (TLS) depending on TLS config
- Forwards connections to RabbitMQ backend on port 5673
- Removed via clients-reconfigured annotation once consumers reconnect
- Includes liveness/readiness probes and TLS certificate mounting
Migration from rabbitmq-cluster-operator:
- Adoption logic reparents existing StatefulSets, Services, and Secrets
from old RabbitmqCluster owner to new RabbitMq CR
- Cleans up old RabbitmqCluster CR after successful adoption
- Fixes stale volumeClaimTemplate ownerReferences that cause new PVCs
to be garbage-collected when scaling up adopted StatefulSets
Testing:
- Comprehensive kuttl tests covering cluster deployment, TLS, scale-up,
version upgrade (with and without TLS), queue migration, Mirrored-to-
Quorum upgrade with version change, resource management
(vhost/user/policy), and migration scenarios
- Updated functional tests for the new controller logic including
VCT fix, combined version+queue migration, and proxy sidecar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 863ae03 commit 2f0db6d
125 files changed
Lines changed: 9637 additions & 1684 deletions
File tree
- apis
- bases
- rabbitmq/v1beta1
- cmd
- config
- crd/bases
- manifests/bases
- rbac
- internal
- controller/rabbitmq
- data
- rabbitmq
- impl
- webhook/rabbitmq/v1beta1
- pkg/rabbitmq/api
- test
- functional
- kuttl/tests
- rabbitmq-cluster
- rabbitmq-migration
- rabbitmq-queue-migration
- rabbitmq-resources
- rabbitmq-scale-up
- rabbitmq-tls
- rabbitmq-upgrade-mirrored
- rabbitmq-upgrade-no-tls
- rabbitmq-version-upgrade
- rabbitmq
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
124 | 131 | | |
125 | | - | |
| 132 | + | |
126 | 133 | | |
127 | 134 | | |
128 | | - | |
| 135 | + | |
129 | 136 | | |
130 | 137 | | |
131 | 138 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
| 8 | + | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | 93 | | |
97 | 94 | | |
98 | 95 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
80 | | - | |
81 | 79 | | |
82 | 80 | | |
83 | | - | |
84 | | - | |
| 81 | + | |
| 82 | + | |
85 | 83 | | |
86 | 84 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 85 | + | |
| 86 | + | |
91 | 87 | | |
92 | 88 | | |
93 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
0 commit comments