Skip to content

Commit b7ffbe7

Browse files
bogdandoauniyal61
authored andcommitted
Add Notfications message bus instance for Nova CRD
Extend CRDs to support a RabbitMqCluster reference as AMQP instance for notifications. To provide a way for human user to define the notifications bus for Nova CR via the OpenStackControlPlane CR's nova section, add a new field to the NovaSpecCore as that is the struct used when the OpenStackControlPlaneSpec struct is defined. At NovaSpec level having just "" or a name of the bus is OK as either we need a bus, or we don't need notifications at all. However, for empedded NovaSpecCore we might need the 3rd possibility to "inherit from somewhere higher", which we represent as: *string field where null means inherit, "" means disable notification, "foo" means send notification to bus foo. Note that overriding NotificationsBusInstance for cells is not supported as that implies that consumers of notifications can maintain simultanous AMQP connections via multiple transport_url endpoints, which is not a thing in Openstack. Assume that in the implementation the required information will be transferred via the existing internal secret via notifications specific transport_url key (as the transport_url key is already taken by the RPC bus value). Thus we do not modify other Nova services' CRDs. Note that the pointer type is redundant for NovaSpec, but since we have already defined it as a such in NovaSpecCore, and changing the types system is not planned (requires changes in openstack operator), it should be used as is for also NovaSpec. However there shall be only a real use of a nil value in NovaSpecCore (while unused in NovaSpec). Signed-off-by: Bohdan Dobrelia <bdobreli@redhat.com>
1 parent b04635f commit b7ffbe7

5 files changed

Lines changed: 36 additions & 2 deletions

File tree

api/bases/nova.openstack.org_nova.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,6 +1624,15 @@ spec:
16241624
NodeSelector here acts as a default value and can be overridden by service
16251625
specific NodeSelector Settings.
16261626
type: object
1627+
notificationsBusInstance:
1628+
description: |-
1629+
NotificationsBusInstance is the name of the RabbitMqCluster CR to select
1630+
the Message Bus Service instance used by the Nova top level services and all cells to publish notifications.
1631+
If undefined, the value will be inherited from OpenStackControlPlane.
1632+
An empty value "" leaves the notification drivers unconfigured and emitting no notifications at all.
1633+
Avoid colocating it with RabbitMqClusterName, APIMessageBusInstance or CellMessageBusInstance used for RPC.
1634+
For particular Nova cells, notifications cannot be disabled, nor configured differently.
1635+
type: string
16271636
novncproxyContainerImageURL:
16281637
description: NoVNCContainerImageURL
16291638
type: string

api/v1beta1/nova_types.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2021
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
2122
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22-
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2323
)
2424

2525
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
@@ -122,10 +122,21 @@ type NovaSpecCore struct {
122122
// TopologyRef to apply the Topology defined by the associated CR referenced
123123
// by name
124124
TopologyRef *topologyv1.TopoRef `json:"topologyRef,omitempty"`
125+
126+
// +kubebuilder:validation:Optional
127+
// NotificationsBusInstance is the name of the RabbitMqCluster CR to select
128+
// the Message Bus Service instance used by the Nova top level services and all cells to publish notifications.
129+
// If undefined, the value will be inherited from OpenStackControlPlane.
130+
// An empty value "" leaves the notification drivers unconfigured and emitting no notifications at all.
131+
// Avoid colocating it with RabbitMqClusterName, APIMessageBusInstance or CellMessageBusInstance used for RPC.
132+
// For particular Nova cells, notifications cannot be disabled, nor configured differently.
133+
NotificationsBusInstance *string `json:"notificationsBusInstance,omitempty"`
125134
}
126135

127136
// NovaSpec defines the desired state of Nova
128137
type NovaSpec struct {
138+
// NOTE(bogdando): Anything that is only submitted by opentack-operator should be in NovaSpec but not in NovaSpecCore.
139+
129140
// +kubebuilder:validation:Required
130141
NovaSpecCore `json:",inline"`
131142

api/v1beta1/novacell_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2021
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
2122
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
2223
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23-
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2424
)
2525

2626
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/nova.openstack.org_nova.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,6 +1624,15 @@ spec:
16241624
NodeSelector here acts as a default value and can be overridden by service
16251625
specific NodeSelector Settings.
16261626
type: object
1627+
notificationsBusInstance:
1628+
description: |-
1629+
NotificationsBusInstance is the name of the RabbitMqCluster CR to select
1630+
the Message Bus Service instance used by the Nova top level services and all cells to publish notifications.
1631+
If undefined, the value will be inherited from OpenStackControlPlane.
1632+
An empty value "" leaves the notification drivers unconfigured and emitting no notifications at all.
1633+
Avoid colocating it with RabbitMqClusterName, APIMessageBusInstance or CellMessageBusInstance used for RPC.
1634+
For particular Nova cells, notifications cannot be disabled, nor configured differently.
1635+
type: string
16271636
novncproxyContainerImageURL:
16281637
description: NoVNCContainerImageURL
16291638
type: string

0 commit comments

Comments
 (0)