Skip to content

Commit fe8dc27

Browse files
Merge pull request #824 from lmiccini/rabbitmq_vhosts
Rabbitmq vhost and user support
2 parents 7d95eae + 873d6fa commit fe8dc27

50 files changed

Lines changed: 1094 additions & 172 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎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: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,23 @@ spec:
130130
description: NodeSelector to target subset of worker nodes running
131131
this service
132132
type: object
133+
notificationsBus:
134+
description: NotificationsBus configuration (username, vhost,
135+
and cluster) for notifications
136+
properties:
137+
cluster:
138+
description: Name of the cluster
139+
minLength: 1
140+
type: string
141+
user:
142+
description: User - RabbitMQ username
143+
type: string
144+
vhost:
145+
description: Vhost - RabbitMQ vhost name
146+
type: string
147+
required:
148+
- cluster
149+
type: object
133150
notifierImage:
134151
type: string
135152
override:
@@ -319,10 +336,10 @@ spec:
319336
e.g. to check logs
320337
type: boolean
321338
rabbitMqClusterName:
322-
default: rabbitmq
323339
description: |-
324340
RabbitMQ instance name
325341
Needed to request a transportURL that is created and used in Aodh
342+
Deprecated: Use NotificationsBus.Cluster instead
326343
type: string
327344
secret:
328345
default: osp-secret
@@ -510,6 +527,10 @@ spec:
510527
items:
511528
type: string
512529
type: array
530+
notificationsURLSecret:
531+
description: NotificationsURLSecret - Secret containing RabbitMQ notification
532+
transportURL
533+
type: string
513534
observedGeneration:
514535
description: |-
515536
ObservedGeneration - the most recent generation observed for this

‎api/bases/telemetry.openstack.org_ceilometers.yaml‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,23 @@ spec:
207207
type: object
208208
notificationImage:
209209
type: string
210+
notificationsBus:
211+
description: NotificationsBus configuration (username, vhost, and
212+
cluster) for notifications
213+
properties:
214+
cluster:
215+
description: Name of the cluster
216+
minLength: 1
217+
type: string
218+
user:
219+
description: User - RabbitMQ username
220+
type: string
221+
vhost:
222+
description: Vhost - RabbitMQ vhost name
223+
type: string
224+
required:
225+
- cluster
226+
type: object
210227
passwordSelector:
211228
default:
212229
ceilometerService: CeilometerPassword
@@ -232,10 +249,10 @@ spec:
232249
proxyImage:
233250
type: string
234251
rabbitMqClusterName:
235-
default: rabbitmq
236252
description: |-
237253
RabbitMQ instance name
238254
Needed to request a transportURL that is created and used in Telemetry
255+
Deprecated: Use NotificationsBus.Cluster instead
239256
type: string
240257
secret:
241258
default: osp-secret
@@ -381,6 +398,10 @@ spec:
381398
items:
382399
type: string
383400
type: array
401+
notificationsURLSecret:
402+
description: NotificationsURLSecret - Secret containing RabbitMQ notification
403+
transportURL
404+
type: string
384405
observedGeneration:
385406
description: |-
386407
ObservedGeneration - the most recent generation observed for this

‎api/bases/telemetry.openstack.org_cloudkitties.yaml‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,22 @@ spec:
558558
default: memcached
559559
description: Memcached instance name.
560560
type: string
561+
messagingBus:
562+
description: MessagingBus configuration (username, vhost, and cluster)
563+
properties:
564+
cluster:
565+
description: Name of the cluster
566+
minLength: 1
567+
type: string
568+
user:
569+
description: User - RabbitMQ username
570+
type: string
571+
vhost:
572+
description: Vhost - RabbitMQ vhost name
573+
type: string
574+
required:
575+
- cluster
576+
type: object
561577
nodeSelector:
562578
additionalProperties:
563579
type: string
@@ -633,10 +649,10 @@ spec:
633649
type: object
634650
x-kubernetes-map-type: atomic
635651
rabbitMqClusterName:
636-
default: rabbitmq
637652
description: |-
638653
RabbitMQ instance name
639654
Needed to request a transportURL that is created and used in CloudKitty
655+
Deprecated: Use MessagingBus.Cluster instead
640656
type: string
641657
s3StorageConfig:
642658
default:

‎api/bases/telemetry.openstack.org_telemetries.yaml‎

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,23 @@ spec:
133133
description: NodeSelector to target subset of worker nodes
134134
running this service
135135
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
136153
notifierImage:
137154
type: string
138155
override:
@@ -322,10 +339,10 @@ spec:
322339
finished e.g. to check logs
323340
type: boolean
324341
rabbitMqClusterName:
325-
default: rabbitmq
326342
description: |-
327343
RabbitMQ instance name
328344
Needed to request a transportURL that is created and used in Aodh
345+
Deprecated: Use NotificationsBus.Cluster instead
329346
type: string
330347
secret:
331348
default: osp-secret
@@ -543,6 +560,23 @@ spec:
543560
type: object
544561
notificationImage:
545562
type: string
563+
notificationsBus:
564+
description: NotificationsBus configuration (username, vhost,
565+
and cluster) for notifications
566+
properties:
567+
cluster:
568+
description: Name of the cluster
569+
minLength: 1
570+
type: string
571+
user:
572+
description: User - RabbitMQ username
573+
type: string
574+
vhost:
575+
description: Vhost - RabbitMQ vhost name
576+
type: string
577+
required:
578+
- cluster
579+
type: object
546580
passwordSelector:
547581
default:
548582
ceilometerService: CeilometerPassword
@@ -568,10 +602,10 @@ spec:
568602
proxyImage:
569603
type: string
570604
rabbitMqClusterName:
571-
default: rabbitmq
572605
description: |-
573606
RabbitMQ instance name
574607
Needed to request a transportURL that is created and used in Telemetry
608+
Deprecated: Use NotificationsBus.Cluster instead
575609
type: string
576610
secret:
577611
default: osp-secret
@@ -1142,6 +1176,23 @@ spec:
11421176
default: memcached
11431177
description: Memcached instance name.
11441178
type: string
1179+
messagingBus:
1180+
description: MessagingBus configuration (username, vhost, and
1181+
cluster)
1182+
properties:
1183+
cluster:
1184+
description: Name of the cluster
1185+
minLength: 1
1186+
type: string
1187+
user:
1188+
description: User - RabbitMQ username
1189+
type: string
1190+
vhost:
1191+
description: Vhost - RabbitMQ vhost name
1192+
type: string
1193+
required:
1194+
- cluster
1195+
type: object
11451196
nodeSelector:
11461197
additionalProperties:
11471198
type: string
@@ -1218,10 +1269,10 @@ spec:
12181269
type: object
12191270
x-kubernetes-map-type: atomic
12201271
rabbitMqClusterName:
1221-
default: rabbitmq
12221272
description: |-
12231273
RabbitMQ instance name
12241274
Needed to request a transportURL that is created and used in CloudKitty
1275+
Deprecated: Use MessagingBus.Cluster instead
12251276
type: string
12261277
s3StorageConfig:
12271278
default:

‎api/go.mod‎

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

55
require (
6-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260108154501-11e5091cddf1
7-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251230215914-6ba873b49a35
6+
github.com/onsi/gomega v1.39.0
7+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260126091827-7758173fbb09
8+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260126081203-efc2df9207eb
89
github.com/rhobs/observability-operator v0.3.1
910
k8s.io/api v0.31.14
1011
k8s.io/apimachinery v0.31.14
@@ -16,7 +17,6 @@ require (
1617
github.com/cespare/xxhash/v2 v2.3.0 // indirect
1718
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
1819
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
19-
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
2020
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
2121
github.com/fsnotify/fsnotify v1.9.0 // indirect
2222
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
@@ -38,12 +38,13 @@ require (
3838
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
3939
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
4040
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
41-
github.com/onsi/gomega v1.39.0 // indirect
41+
github.com/onsi/ginkgo/v2 v2.27.4 // indirect
4242
github.com/pkg/errors v0.9.1 // indirect
4343
github.com/prometheus/client_golang v1.22.0 // indirect
4444
github.com/prometheus/client_model v0.6.2 // indirect
4545
github.com/prometheus/common v0.65.0 // indirect
4646
github.com/prometheus/procfs v0.16.1 // indirect
47+
github.com/rabbitmq/cluster-operator/v2 v2.16.0 // indirect
4748
github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring v0.71.0-rhobs1 // indirect
4849
github.com/spf13/pflag v1.0.7 // indirect
4950
github.com/x448/float16 v0.8.4 // indirect

‎api/go.sum‎

Lines changed: 9 additions & 6 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=
@@ -74,14 +75,16 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd
7475
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
7576
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
7677
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
77-
github.com/onsi/ginkgo/v2 v2.27.3 h1:ICsZJ8JoYafeXFFlFAG75a7CxMsJHwgKwtO+82SE9L8=
78-
github.com/onsi/ginkgo/v2 v2.27.3/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
78+
github.com/onsi/ginkgo/v2 v2.27.4 h1:fcEcQW/A++6aZAZQNUmNjvA9PSOzefMJBerHJ4t8v8Y=
79+
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.20260108154501-11e5091cddf1 h1:zAbZVtpldi1TU/CO9aU2ZByzcsi+N3aIv6snpSjBVLY=
82-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260108154501-11e5091cddf1/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/autoscaling_types.go‎

Lines changed: 9 additions & 1 deletion
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
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
2223
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
@@ -63,9 +64,13 @@ type AodhCore struct {
6364
// APITimeout for Route and Apache
6465
APITimeout int `json:"apiTimeout"`
6566

67+
// +kubebuilder:validation:Optional
68+
// NotificationsBus configuration (username, vhost, and cluster) for notifications
69+
NotificationsBus *rabbitmqv1.RabbitMqConfig `json:"notificationsBus,omitempty"`
70+
6671
// RabbitMQ instance name
6772
// Needed to request a transportURL that is created and used in Aodh
68-
// +kubebuilder:default=rabbitmq
73+
// Deprecated: Use NotificationsBus.Cluster instead
6974
RabbitMqClusterName string `json:"rabbitMqClusterName,omitempty"`
7075

7176
// +kubebuilder:validation:Required
@@ -206,6 +211,9 @@ type AutoscalingStatus struct {
206211
// TransportURLSecret - Secret containing RabbitMQ transportURL
207212
TransportURLSecret string `json:"transportURLSecret,omitempty"`
208213

214+
// NotificationsURLSecret - Secret containing RabbitMQ notification transportURL
215+
NotificationsURLSecret *string `json:"notificationsURLSecret,omitempty"`
216+
209217
// DatabaseHostname - Hostname for the database
210218
DatabaseHostname string `json:"databaseHostname,omitempty"`
211219

0 commit comments

Comments
 (0)