Skip to content

Commit ca09bc2

Browse files
Merge pull request #556 from lmiccini/rabbitmq_vhosts
Rabbitmq vhost and user support
2 parents fee89a8 + b5b99ab commit ca09bc2

25 files changed

+800
-68
lines changed

api/bases/octavia.openstack.org_octaviaamphoracontrollers.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ spec:
140140
description: NodeSelector to target subset of worker nodes running
141141
this service
142142
type: object
143+
notificationsTransportURLSecret:
144+
description: NotificationsTransportURLSecret - Secret containing RabbitMQ
145+
notifications transportURL
146+
type: string
143147
octaviaProviderSubnetCIDR:
144148
description: OctaviaProviderSubnetCIDR -
145149
type: string

api/bases/octavia.openstack.org_octaviaapis.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ spec:
108108
description: NodeSelector to target subset of worker nodes running
109109
this service
110110
type: object
111+
notificationsTransportURLSecret:
112+
description: NotificationsTransportURLSecret - Secret containing RabbitMQ
113+
notifications transportURL
114+
type: string
111115
override:
112116
description: Override, provides the ability to override the generated
113117
manifest of several child resources.

api/bases/octavia.openstack.org_octavias.yaml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,45 @@ spec:
157157
creates the Neutron resources needed for its Management Network
158158
type: boolean
159159
type: object
160+
messagingBus:
161+
description: MessagingBus configuration (cluster, username, and vhost)
162+
properties:
163+
cluster:
164+
description: Name of the cluster
165+
minLength: 1
166+
type: string
167+
user:
168+
description: User - RabbitMQ username
169+
type: string
170+
vhost:
171+
description: Vhost - RabbitMQ vhost name
172+
type: string
173+
required:
174+
- cluster
175+
type: object
160176
nodeSelector:
161177
additionalProperties:
162178
type: string
163179
description: NodeSelector to target subset of worker nodes running
164180
this service
165181
type: object
182+
notificationsBus:
183+
description: NotificationsBus configuration (cluster, username, and
184+
vhost) for a dedicated notifications RabbitMQ cluster
185+
properties:
186+
cluster:
187+
description: Name of the cluster
188+
minLength: 1
189+
type: string
190+
user:
191+
description: User - RabbitMQ username
192+
type: string
193+
vhost:
194+
description: Vhost - RabbitMQ vhost name
195+
type: string
196+
required:
197+
- cluster
198+
type: object
166199
octaviaAPI:
167200
description: OctaviaAPI - Spec definition for the API service of the
168201
Octavia deployment
@@ -223,6 +256,10 @@ spec:
223256
description: NodeSelector to target subset of worker nodes running
224257
this service
225258
type: object
259+
notificationsTransportURLSecret:
260+
description: NotificationsTransportURLSecret - Secret containing
261+
RabbitMQ notifications transportURL
262+
type: string
226263
override:
227264
description: Override, provides the ability to override the generated
228265
manifest of several child resources.
@@ -658,6 +695,10 @@ spec:
658695
description: NodeSelector to target subset of worker nodes running
659696
this service
660697
type: object
698+
notificationsTransportURLSecret:
699+
description: NotificationsTransportURLSecret - Secret containing
700+
RabbitMQ notifications transportURL
701+
type: string
661702
octaviaProviderSubnetCIDR:
662703
description: OctaviaProviderSubnetCIDR -
663704
type: string
@@ -914,6 +955,10 @@ spec:
914955
description: NodeSelector to target subset of worker nodes running
915956
this service
916957
type: object
958+
notificationsTransportURLSecret:
959+
description: NotificationsTransportURLSecret - Secret containing
960+
RabbitMQ notifications transportURL
961+
type: string
917962
octaviaProviderSubnetCIDR:
918963
description: OctaviaProviderSubnetCIDR -
919964
type: string
@@ -1346,6 +1391,10 @@ spec:
13461391
description: NodeSelector to target subset of worker nodes running
13471392
this service
13481393
type: object
1394+
notificationsTransportURLSecret:
1395+
description: NotificationsTransportURLSecret - Secret containing
1396+
RabbitMQ notifications transportURL
1397+
type: string
13491398
octaviaProviderSubnetCIDR:
13501399
description: OctaviaProviderSubnetCIDR -
13511400
type: string
@@ -1539,10 +1588,10 @@ spec:
15391588
e.g. to check logs
15401589
type: boolean
15411590
rabbitMqClusterName:
1542-
default: rabbitmq
15431591
description: |-
15441592
RabbitMQ instance name
15451593
Needed to request a transportURL that is created and used in Octavia
1594+
Deprecated: Use MessagingBus.Cluster instead
15461595
type: string
15471596
redisServiceName:
15481597
default: octavia-redis
@@ -1662,7 +1711,6 @@ spec:
16621711
- databaseInstance
16631712
- octaviaAPI
16641713
- octaviaNetworkAttachment
1665-
- rabbitMqClusterName
16661714
- secret
16671715
type: object
16681716
status:
@@ -1730,6 +1778,10 @@ spec:
17301778
description: ReadyCount of octavia Housekeeping instances
17311779
format: int32
17321780
type: integer
1781+
notificationsTransportURLSecret:
1782+
description: NotificationsTransportURLSecret - Secret containing RabbitMQ
1783+
notifications transportURL
1784+
type: string
17331785
observedGeneration:
17341786
description: |-
17351787
ObservedGeneration - the most recent generation observed for this

api/go.mod

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module github.com/openstack-k8s-operators/octavia-operator/api
33
go 1.24.4
44

55
require (
6-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260123105816-865d02e287a9
7-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251230215914-6ba873b49a35
6+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260126091827-7758173fbb09
7+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260126081203-efc2df9207eb
88
k8s.io/api v0.31.14
99
k8s.io/apimachinery v0.31.14
1010
sigs.k8s.io/controller-runtime v0.19.7
@@ -15,7 +15,6 @@ require (
1515
github.com/cespare/xxhash/v2 v2.3.0 // indirect
1616
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
1717
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
18-
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
1918
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
2019
github.com/fsnotify/fsnotify v1.9.0 // indirect
2120
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
@@ -38,12 +37,12 @@ require (
3837
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
3938
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
4039
github.com/onsi/ginkgo/v2 v2.27.4 // indirect
41-
github.com/onsi/gomega v1.39.0 // indirect
4240
github.com/pkg/errors v0.9.1 // indirect
4341
github.com/prometheus/client_golang v1.22.0 // indirect
4442
github.com/prometheus/client_model v0.6.2 // indirect
4543
github.com/prometheus/common v0.65.0 // indirect
4644
github.com/prometheus/procfs v0.16.1 // indirect
45+
github.com/rabbitmq/cluster-operator/v2 v2.16.0 // indirect
4746
github.com/spf13/pflag v1.0.7 // indirect
4847
github.com/stretchr/testify v1.11.1 // indirect
4948
github.com/x448/float16 v0.8.4 // indirect

api/go.sum

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
12
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
23
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
34
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
@@ -78,10 +79,12 @@ github.com/onsi/ginkgo/v2 v2.27.4 h1:fcEcQW/A++6aZAZQNUmNjvA9PSOzefMJBerHJ4t8v8Y
7879
github.com/onsi/ginkgo/v2 v2.27.4/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
7980
github.com/onsi/gomega v1.39.0 h1:y2ROC3hKFmQZJNFeGAMeHZKkjBL65mIZcvrLQBF9k6Q=
8081
github.com/onsi/gomega v1.39.0/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4=
81-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260123105816-865d02e287a9 h1:tD6nnTRcyUCXdVMWPHLApk12tzQlQni5eoxvQ8XdbP8=
82-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260123105816-865d02e287a9/go.mod h1:ZXwFlspJCdZEUjMbmaf61t5AMB4u2vMyAMMoe/vJroE=
83-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251230215914-6ba873b49a35 h1:pF3mJ3nwq6r4qwom+rEWZNquZpcQW/iftHlJ1KPIDsk=
84-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251230215914-6ba873b49a35/go.mod h1:kycZyoe7OZdW1HUghr2nI3N7wSJtNahXf6b/ypD14f4=
82+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260126091827-7758173fbb09 h1:vhAGLKZitJIffj7ONiPpKmOX7Tmt/LGJpaY0Z2LeyfQ=
83+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260126091827-7758173fbb09/go.mod h1:ZXwFlspJCdZEUjMbmaf61t5AMB4u2vMyAMMoe/vJroE=
84+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260126081203-efc2df9207eb h1:S7tnYO/E1f1KQfcp7N5bam8+ax/ExDTOhZ1WqG4Bfu0=
85+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260126081203-efc2df9207eb/go.mod h1:ndqfy1KbVorHH6+zlUFPIrCRhMSxO3ImYJUGaooE0x0=
86+
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20250929174222-a0d328fa4dec h1:saovr368HPAKHN0aRPh8h8n9s9dn3d8Frmfua0UYRlc=
87+
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20250929174222-a0d328fa4dec/go.mod h1:Nh2NEePLjovUQof2krTAg4JaAoLacqtPTZQXK6izNfg=
8588
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
8689
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
8790
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=

api/v1beta1/amphoracontroller_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ type OctaviaAmphoraControllerSpecCore struct {
110110
// TransportURLSecret - Secret containing RabbitMQ transportURL
111111
TransportURLSecret string `json:"transportURLSecret,omitempty"`
112112

113+
// +kubebuilder:validation:Optional
114+
// NotificationsTransportURLSecret - Secret containing RabbitMQ notifications transportURL
115+
NotificationsTransportURLSecret string `json:"notificationsTransportURLSecret,omitempty"`
116+
113117
// +kubebuilder:validation:Optional
114118
// Resources - Compute Resources required by this service (Limits/Requests).
115119
// https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

api/v1beta1/conditions.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const (
4242
OctaviaRsyslogReadyCondition condition.Type = "OctaviaRsyslogReady"
4343

4444
OctaviaManagementNetworkReadyCondition condition.Type = "OctaviaManagementNetworkReady"
45+
46+
OctaviaRabbitMqNotificationsTransportURLReadyCondition condition.Type = "OctaviaRabbitMqNotificationsTransportURLReady"
4547
)
4648

4749
// Common Messages used by API objects
@@ -144,4 +146,16 @@ const (
144146

145147
// OctaviaManagementNetworkReadyCompleteMessage
146148
OctaviaManagementNetworkReadyCompleteMessage = "Octavia Management Network setup completed"
149+
150+
//
151+
// OctaviaRabbitMqNotificationsTransportURLReady condition messages
152+
//
153+
// OctaviaRabbitMqNotificationsTransportURLReadyInitMessage
154+
OctaviaRabbitMqNotificationsTransportURLReadyInitMessage = "Octavia RabbitMQ notifications transport URL not initialized"
155+
156+
// OctaviaRabbitMqNotificationsTransportURLReadyErrorMessage
157+
OctaviaRabbitMqNotificationsTransportURLReadyErrorMessage = "Octavia RabbitMQ notifications transport URL error occurred %s"
158+
159+
// OctaviaRabbitMqNotificationsTransportURLReadyMessage
160+
OctaviaRabbitMqNotificationsTransportURLReadyMessage = "Octavia RabbitMQ notifications transport URL ready"
147161
)

api/v1beta1/octavia_types.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
rabbitmqv1 "github.com/openstack-k8s-operators/infra-operator/apis/rabbitmq/v1beta1"
2021
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2122
"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
2223
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
@@ -126,11 +127,19 @@ type OctaviaSpecBase struct {
126127
// to connect for the persistence database
127128
PersistenceDatabaseAccount string `json:"persistenceDatabaseAccount"`
128129

129-
// +kubebuilder:validation:Required
130-
// +kubebuilder:default=rabbitmq
130+
// +kubebuilder:validation:Optional
131131
// RabbitMQ instance name
132132
// Needed to request a transportURL that is created and used in Octavia
133-
RabbitMqClusterName string `json:"rabbitMqClusterName"`
133+
// Deprecated: Use MessagingBus.Cluster instead
134+
RabbitMqClusterName string `json:"rabbitMqClusterName,omitempty"`
135+
136+
// +kubebuilder:validation:Optional
137+
// MessagingBus configuration (cluster, username, and vhost)
138+
MessagingBus rabbitmqv1.RabbitMqConfig `json:"messagingBus,omitempty"`
139+
140+
// +kubebuilder:validation:Optional
141+
// NotificationsBus configuration (cluster, username, and vhost) for a dedicated notifications RabbitMQ cluster
142+
NotificationsBus *rabbitmqv1.RabbitMqConfig `json:"notificationsBus,omitempty"`
134143

135144
// +kubebuilder:validation:Optional
136145
// +kubebuilder:default=octavia
@@ -317,6 +326,9 @@ type OctaviaStatus struct {
317326
// TransportURLSecret - Secret containing RabbitMQ transportURL
318327
TransportURLSecret string `json:"transportURLSecret,omitempty"`
319328

329+
// NotificationsTransportURLSecret - Secret containing RabbitMQ notifications transportURL
330+
NotificationsTransportURLSecret string `json:"notificationsTransportURLSecret,omitempty"`
331+
320332
// ReadyCount of octavia API instances
321333
OctaviaAPIReadyCount int32 `json:"apireadyCount,omitempty"`
322334

0 commit comments

Comments
 (0)