Skip to content

Commit 60e0ea3

Browse files
committed
Common Notifications bus interface for services
Add a top level field in OpenStackControlPlaneSpec field that holds a a RabbitMQ cluster CR name reference to be used for publishing and consuming of notifications in the managed OpenStack instance. Allow overriding it in OpenStack services templates. Note about a special handling expected for an empty value by the services that will be supporting this interface. It should provide backwards compatibility during oscp and services CRDs upgrades. There is no an empty value handling top scope (cannot disable notifications top-scope as a cluster-wide), however. It may only take a default value of a 'rabbitmq'. Use the service templates to override it for an empty value, if needed. The proposed CRD design is not expandable into supporting additional messaging backends (provided via direct transport_url secret refs, or the like). For that, the structure should be used instead of a simple string value. Assume openstack-operator controller should implement a basic inheritance mechanism from the top level field to the service template based on the following rules: if OSCP.Spec.<service_name>.Template.NotificationsBusInstance == nil OSCP.Spec.<service_name>.Template.NotificationsBusInstance = \ OSCP.Spec.NotificationsBus.RabbitMqClusterName We leave further handling of empty values for the services specific implementation. Assume a similar pattern to be applied later for KeystoneAPI.Spec.RabbitMqClusterName and other services that need to consume or publish notifications to keep things consistent across the board. Signed-off-by: Bohdan Dobrelia <bdobreli@redhat.com>
1 parent 7b57a2e commit 60e0ea3

4 files changed

Lines changed: 18 additions & 1 deletion

File tree

apis/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9498,6 +9498,9 @@ spec:
94989498
additionalProperties:
94999499
type: string
95009500
type: object
9501+
notificationsBus:
9502+
default: rabbitmq
9503+
type: string
95019504
nova:
95029505
properties:
95039506
apiOverride:

apis/core/v1beta1/openstackcontrolplane_types.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ type OpenStackControlPlaneSpec struct {
126126
// Rabbitmq - Parameters related to the Rabbitmq service
127127
Rabbitmq RabbitmqSection `json:"rabbitmq,omitempty"`
128128

129+
// +kubebuilder:validation:Optional
130+
// +kubebuilder:default=rabbitmq
131+
// NotificationsBus - the name of RabbitMQ Cluster CR to select a Messaging
132+
// Bus Service instance used by all services that produce or consume notifications.
133+
// Avoid colocating it with RabbitMQ services used for PRC.
134+
// That instance will be pushed down for services, unless overriden in templates.
135+
NotificationsBus string `json:"notificationsBus"`
136+
129137
// +kubebuilder:validation:Optional
130138
// +operator-sdk:csv:customresourcedefinitions:type=spec
131139
// Memcached - Parameters related to the Memcached service
@@ -484,7 +492,7 @@ type RabbitmqSection struct {
484492

485493
// +kubebuilder:validation:Optional
486494
// +operator-sdk:csv:customresourcedefinitions:type=spec
487-
// Templates - Overrides to use when creating the Rabbitmq clusters
495+
// Templates - Overrides to use when creating the Rabbitmq clusters for RPC and (optionally) Notifications.
488496
Templates *map[string]rabbitmqv1.RabbitMqSpecCore `json:"templates"`
489497
}
490498

bindata/crds/crds.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9662,6 +9662,9 @@ spec:
96629662
additionalProperties:
96639663
type: string
96649664
type: object
9665+
notificationsBus:
9666+
default: rabbitmq
9667+
type: string
96659668
nova:
96669669
properties:
96679670
apiOverride:

config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9498,6 +9498,9 @@ spec:
94989498
additionalProperties:
94999499
type: string
95009500
type: object
9501+
notificationsBus:
9502+
default: rabbitmq
9503+
type: string
95019504
nova:
95029505
properties:
95039506
apiOverride:

0 commit comments

Comments
 (0)