Skip to content

Commit 9a16afb

Browse files
committed
Rabbitmq vhost and user support
Add support for a dedicated rabbitmq cluster for notifications. Add new messagingBus and notificationsBus interfaces to hold cluster, user and vhost names for optional usage. The controller adds these values to the TransportURL create request when present. Additionally, we migrate RabbitMQ cluster name to RabbitMq config struct using DefaultRabbitMqConfig from infra-operator to automatically populate the new Cluster field from legacy RabbitMqClusterName. Example usage: spec: messagingBus: cluster: rpc-rabbitmq user: rpc-user vhost: rpc-vhost notificationsBus: cluster: notifications-rabbitmq user: notifications-user vhost: notifications-vhost Jira: https://issues.redhat.com/browse/OSPRH-23909
1 parent 69bf8ba commit 9a16afb

31 files changed

+1120
-70
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ tidy: ## Run go mod tidy on every mod file in the repo
116116

117117
.PHONY: test
118118
test: manifests generate fmt vet envtest ## Run tests.
119-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
119+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... ./api/... -coverprofile cover.out
120120

121121
##@ Build
122122

api/bases/telemetry.openstack.org_autoscalings.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,23 @@ spec:
104104
default: memcached
105105
description: Memcached instance name.
106106
type: string
107+
messagingBus:
108+
description: MessagingBus configuration (username, vhost, and
109+
cluster)
110+
properties:
111+
cluster:
112+
description: Name of the cluster
113+
minLength: 1
114+
type: string
115+
user:
116+
description: User - RabbitMQ username
117+
type: string
118+
vhost:
119+
description: Vhost - RabbitMQ vhost name
120+
type: string
121+
required:
122+
- cluster
123+
type: object
107124
networkAttachmentDefinitions:
108125
description: NetworkAttachmentDefinitions list of network attachment
109126
definitions the service pod gets attached to
@@ -116,6 +133,23 @@ spec:
116133
description: NodeSelector to target subset of worker nodes running
117134
this service
118135
type: object
136+
notificationsBus:
137+
description: NotificationsBus configuration (username, vhost,
138+
and cluster) for notifications
139+
properties:
140+
cluster:
141+
description: Name of the cluster
142+
minLength: 1
143+
type: string
144+
user:
145+
description: User - RabbitMQ username
146+
type: string
147+
vhost:
148+
description: Vhost - RabbitMQ vhost name
149+
type: string
150+
required:
151+
- cluster
152+
type: object
119153
notifierImage:
120154
type: string
121155
override:
@@ -309,6 +343,7 @@ spec:
309343
description: |-
310344
RabbitMQ instance name
311345
Needed to request a transportURL that is created and used in Aodh
346+
Deprecated: Use MessagingBus.Cluster instead
312347
type: string
313348
secret:
314349
default: osp-secret
@@ -496,6 +531,10 @@ spec:
496531
items:
497532
type: string
498533
type: array
534+
notificationsURLSecret:
535+
description: NotificationsURLSecret - Secret containing RabbitMQ notification
536+
transportURL
537+
type: string
499538
observedGeneration:
500539
description: |-
501540
ObservedGeneration - the most recent generation observed for this

api/bases/telemetry.openstack.org_ceilometers.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,22 @@ spec:
153153
description: SecretName - holding the cert, key for the service
154154
type: string
155155
type: object
156+
messagingBus:
157+
description: MessagingBus configuration (username, vhost, and cluster)
158+
properties:
159+
cluster:
160+
description: Name of the cluster
161+
minLength: 1
162+
type: string
163+
user:
164+
description: User - RabbitMQ username
165+
type: string
166+
vhost:
167+
description: Vhost - RabbitMQ vhost name
168+
type: string
169+
required:
170+
- cluster
171+
type: object
156172
mysqldExporterDatabaseAccountPrefix:
157173
default: mysqld-exporter
158174
description: |-
@@ -193,6 +209,23 @@ spec:
193209
type: object
194210
notificationImage:
195211
type: string
212+
notificationsBus:
213+
description: NotificationsBus configuration (username, vhost, and
214+
cluster) for notifications
215+
properties:
216+
cluster:
217+
description: Name of the cluster
218+
minLength: 1
219+
type: string
220+
user:
221+
description: User - RabbitMQ username
222+
type: string
223+
vhost:
224+
description: Vhost - RabbitMQ vhost name
225+
type: string
226+
required:
227+
- cluster
228+
type: object
196229
passwordSelector:
197230
default:
198231
ceilometerService: CeilometerPassword
@@ -222,6 +255,7 @@ spec:
222255
description: |-
223256
RabbitMQ instance name
224257
Needed to request a transportURL that is created and used in Telemetry
258+
Deprecated: Use MessagingBus.Cluster instead
225259
type: string
226260
secret:
227261
default: osp-secret
@@ -367,6 +401,10 @@ spec:
367401
items:
368402
type: string
369403
type: array
404+
notificationsURLSecret:
405+
description: NotificationsURLSecret - Secret containing RabbitMQ notification
406+
transportURL
407+
type: string
370408
observedGeneration:
371409
description: |-
372410
ObservedGeneration - the most recent generation observed for this

api/bases/telemetry.openstack.org_cloudkitties.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,22 @@ spec:
523523
default: memcached
524524
description: Memcached instance name.
525525
type: string
526+
messagingBus:
527+
description: MessagingBus configuration (username, vhost, and cluster)
528+
properties:
529+
cluster:
530+
description: Name of the cluster
531+
minLength: 1
532+
type: string
533+
user:
534+
description: User - RabbitMQ username
535+
type: string
536+
vhost:
537+
description: Vhost - RabbitMQ vhost name
538+
type: string
539+
required:
540+
- cluster
541+
type: object
526542
nodeSelector:
527543
additionalProperties:
528544
type: string
@@ -531,6 +547,23 @@ spec:
531547
NodeSelector here acts as a default value and can be overridden by service
532548
specific NodeSelector Settings.
533549
type: object
550+
notificationsBus:
551+
description: NotificationsBus configuration (username, vhost, and
552+
cluster) for notifications
553+
properties:
554+
cluster:
555+
description: Name of the cluster
556+
minLength: 1
557+
type: string
558+
user:
559+
description: User - RabbitMQ username
560+
type: string
561+
vhost:
562+
description: Vhost - RabbitMQ vhost name
563+
type: string
564+
required:
565+
- cluster
566+
type: object
534567
passwordSelector:
535568
default:
536569
cloudKittyService: CloudKittyPassword
@@ -602,6 +635,7 @@ spec:
602635
description: |-
603636
RabbitMQ instance name
604637
Needed to request a transportURL that is created and used in CloudKitty
638+
Deprecated: Use MessagingBus.Cluster instead
605639
type: string
606640
s3StorageConfig:
607641
default:
@@ -771,6 +805,10 @@ spec:
771805
type: string
772806
description: Map of hashes to track e.g. job status
773807
type: object
808+
notificationsURLSecret:
809+
description: NotificationsURLSecret - Secret containing RabbitMQ notification
810+
transportURL
811+
type: string
774812
observedGeneration:
775813
description: |-
776814
ObservedGeneration - the most recent generation observed for this service.

api/bases/telemetry.openstack.org_telemetries.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,23 @@ spec:
107107
default: memcached
108108
description: Memcached instance name.
109109
type: string
110+
messagingBus:
111+
description: MessagingBus configuration (username, vhost,
112+
and cluster)
113+
properties:
114+
cluster:
115+
description: Name of the cluster
116+
minLength: 1
117+
type: string
118+
user:
119+
description: User - RabbitMQ username
120+
type: string
121+
vhost:
122+
description: Vhost - RabbitMQ vhost name
123+
type: string
124+
required:
125+
- cluster
126+
type: object
110127
networkAttachmentDefinitions:
111128
description: NetworkAttachmentDefinitions list of network
112129
attachment definitions the service pod gets attached to
@@ -119,6 +136,23 @@ spec:
119136
description: NodeSelector to target subset of worker nodes
120137
running this service
121138
type: object
139+
notificationsBus:
140+
description: NotificationsBus configuration (username, vhost,
141+
and cluster) for notifications
142+
properties:
143+
cluster:
144+
description: Name of the cluster
145+
minLength: 1
146+
type: string
147+
user:
148+
description: User - RabbitMQ username
149+
type: string
150+
vhost:
151+
description: Vhost - RabbitMQ vhost name
152+
type: string
153+
required:
154+
- cluster
155+
type: object
122156
notifierImage:
123157
type: string
124158
override:
@@ -312,6 +346,7 @@ spec:
312346
description: |-
313347
RabbitMQ instance name
314348
Needed to request a transportURL that is created and used in Aodh
349+
Deprecated: Use MessagingBus.Cluster instead
315350
type: string
316351
secret:
317352
default: osp-secret
@@ -475,6 +510,23 @@ spec:
475510
description: SecretName - holding the cert, key for the service
476511
type: string
477512
type: object
513+
messagingBus:
514+
description: MessagingBus configuration (username, vhost, and
515+
cluster)
516+
properties:
517+
cluster:
518+
description: Name of the cluster
519+
minLength: 1
520+
type: string
521+
user:
522+
description: User - RabbitMQ username
523+
type: string
524+
vhost:
525+
description: Vhost - RabbitMQ vhost name
526+
type: string
527+
required:
528+
- cluster
529+
type: object
478530
mysqldExporterDatabaseAccountPrefix:
479531
default: mysqld-exporter
480532
description: |-
@@ -515,6 +567,23 @@ spec:
515567
type: object
516568
notificationImage:
517569
type: string
570+
notificationsBus:
571+
description: NotificationsBus configuration (username, vhost,
572+
and cluster) for notifications
573+
properties:
574+
cluster:
575+
description: Name of the cluster
576+
minLength: 1
577+
type: string
578+
user:
579+
description: User - RabbitMQ username
580+
type: string
581+
vhost:
582+
description: Vhost - RabbitMQ vhost name
583+
type: string
584+
required:
585+
- cluster
586+
type: object
518587
passwordSelector:
519588
default:
520589
ceilometerService: CeilometerPassword
@@ -544,6 +613,7 @@ spec:
544613
description: |-
545614
RabbitMQ instance name
546615
Needed to request a transportURL that is created and used in Telemetry
616+
Deprecated: Use MessagingBus.Cluster instead
547617
type: string
548618
secret:
549619
default: osp-secret
@@ -1088,6 +1158,23 @@ spec:
10881158
default: memcached
10891159
description: Memcached instance name.
10901160
type: string
1161+
messagingBus:
1162+
description: MessagingBus configuration (username, vhost, and
1163+
cluster)
1164+
properties:
1165+
cluster:
1166+
description: Name of the cluster
1167+
minLength: 1
1168+
type: string
1169+
user:
1170+
description: User - RabbitMQ username
1171+
type: string
1172+
vhost:
1173+
description: Vhost - RabbitMQ vhost name
1174+
type: string
1175+
required:
1176+
- cluster
1177+
type: object
10911178
nodeSelector:
10921179
additionalProperties:
10931180
type: string
@@ -1096,6 +1183,23 @@ spec:
10961183
NodeSelector here acts as a default value and can be overridden by service
10971184
specific NodeSelector Settings.
10981185
type: object
1186+
notificationsBus:
1187+
description: NotificationsBus configuration (username, vhost,
1188+
and cluster) for notifications
1189+
properties:
1190+
cluster:
1191+
description: Name of the cluster
1192+
minLength: 1
1193+
type: string
1194+
user:
1195+
description: User - RabbitMQ username
1196+
type: string
1197+
vhost:
1198+
description: Vhost - RabbitMQ vhost name
1199+
type: string
1200+
required:
1201+
- cluster
1202+
type: object
10991203
passwordSelector:
11001204
default:
11011205
cloudKittyService: CloudKittyPassword
@@ -1168,6 +1272,7 @@ spec:
11681272
description: |-
11691273
RabbitMQ instance name
11701274
Needed to request a transportURL that is created and used in CloudKitty
1275+
Deprecated: Use MessagingBus.Cluster instead
11711276
type: string
11721277
s3StorageConfig:
11731278
default:

0 commit comments

Comments
 (0)