Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions api/bases/manila.openstack.org_manilas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,22 @@ spec:
default: memcached
description: Memcached instance name.
type: string
messagingBus:
description: MessagingBus configuration (username, vhost, and cluster)
properties:
cluster:
description: Name of the cluster
minLength: 1
type: string
user:
description: User - RabbitMQ username
type: string
vhost:
description: Vhost - RabbitMQ vhost name
type: string
required:
- cluster
type: object
nodeSelector:
additionalProperties:
type: string
Expand All @@ -1796,6 +1812,23 @@ spec:
NodeSelector here acts as a default value and can be overridden by service
specific NodeSelector Settings.
type: object
notificationsBus:
description: NotificationsBus configuration (username, vhost, and
cluster) for notifications
properties:
cluster:
description: Name of the cluster
minLength: 1
type: string
user:
description: User - RabbitMQ username
type: string
vhost:
description: Vhost - RabbitMQ vhost name
type: string
required:
- cluster
type: object
notificationsBusInstance:
description: |-
RabbitMQ instance name used to request a transportURL that is used for
Expand Down
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
Expand All @@ -43,6 +42,7 @@ require (
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.65.0 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/rabbitmq/cluster-operator/v2 v2.16.0 // indirect
github.com/spf13/pflag v1.0.7 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
Expand Down
3 changes: 3 additions & 0 deletions api/go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down Expand Up @@ -84,6 +85,8 @@ github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.2025123021
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251230215914-6ba873b49a35/go.mod h1:kycZyoe7OZdW1HUghr2nI3N7wSJtNahXf6b/ypD14f4=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20251230215914-6ba873b49a35 h1:8WZYfCt1VJHa5sJRX0UhpmoXud/fn8LHQhXsakdYXuQ=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20251230215914-6ba873b49a35/go.mod h1:H0aQANk8iJPRhS2Bg9n6cYb/IHF0Cks9g7+uZG04Rhk=
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20250929174222-a0d328fa4dec h1:saovr368HPAKHN0aRPh8h8n9s9dn3d8Frmfua0UYRlc=
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20250929174222-a0d328fa4dec/go.mod h1:Nh2NEePLjovUQof2krTAg4JaAoLacqtPTZQXK6izNfg=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down
18 changes: 18 additions & 0 deletions api/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ const (

// ManilaShareReadyCondition Status=True condition which indicates if the ManilaShare is configured and operational
ManilaShareReadyCondition condition.Type = "ManilaShareReady"

// ManilaNotificationBusReadyCondition Status=True condition which indicates if the NotificationBus is configured
ManilaNotificationBusReadyCondition condition.Type = "ManilaNotificationBusReady"
)

// Common Messages used by API objects.
Expand Down Expand Up @@ -60,4 +63,19 @@ const (

// ManilaShareReadyRunningMessage
ManilaShareReadyRunningMessage = "ManilaShare deployments in progress"

//
// ManilaNotificationBusReady condition messages
//
// ManilaNotificationBusReadyInitMessage
ManilaNotificationBusReadyInitMessage = "ManilaNotificationBus not started"

// ManilaNotificationBusReadyRunningMessage
ManilaNotificationBusReadyRunningMessage = "ManilaNotificationBus creation in progress"

// ManilaNotificationBusReadyMessage
ManilaNotificationBusReadyMessage = "ManilaNotificationBus successfully created"

// ManilaNotificationBusReadyErrorMessage
ManilaNotificationBusReadyErrorMessage = "ManilaNotificationBus error occured %s"
)
9 changes: 9 additions & 0 deletions api/v1beta1/manila_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1beta1

import (
rabbitmqv1 "github.com/openstack-k8s-operators/infra-operator/apis/rabbitmq/v1beta1"
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
"github.com/openstack-k8s-operators/lib-common/modules/storage"
Expand Down Expand Up @@ -82,6 +83,14 @@ type ManilaSpecBase struct {
// Needed to request a transportURL that is created and used in Manila
RabbitMqClusterName string `json:"rabbitMqClusterName"`

// +kubebuilder:validation:Optional
// MessagingBus configuration (username, vhost, and cluster)
MessagingBus rabbitmqv1.RabbitMqConfig `json:"messagingBus,omitempty"`

// +kubebuilder:validation:Optional
// NotificationsBus configuration (username, vhost, and cluster) for notifications
NotificationsBus *rabbitmqv1.RabbitMqConfig `json:"notificationsBus,omitempty"`

// +kubebuilder:validation:Required
// +kubebuilder:default=memcached
// Memcached instance name.
Expand Down
43 changes: 43 additions & 0 deletions api/v1beta1/manila_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package v1beta1
import (
"fmt"

rabbitmqv1 "github.com/openstack-k8s-operators/infra-operator/apis/rabbitmq/v1beta1"
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
Expand Down Expand Up @@ -101,6 +102,18 @@ func (spec *ManilaSpec) Default() {

// Default - set defaults for this Manila spec base
func (spec *ManilaSpecBase) Default() {
// Default MessagingBus with cluster name from RabbitMqClusterName
rabbitmqv1.DefaultRabbitMqConfig(&spec.MessagingBus, spec.RabbitMqClusterName)

// Default NotificationsBus if NotificationsBusInstance is specified
if spec.NotificationsBusInstance != nil && *spec.NotificationsBusInstance != "" {
if spec.NotificationsBus == nil {
// Initialize empty NotificationsBus - credentials will be created dynamically
// to ensure separation from MessagingBus (RPC and notifications should never share credentials)
spec.NotificationsBus = &rabbitmqv1.RabbitMqConfig{}
}
rabbitmqv1.DefaultRabbitMqConfig(spec.NotificationsBus, *spec.NotificationsBusInstance)
}

if spec.APITimeout == 0 {
spec.APITimeout = manilaDefaults.APITimeout
Expand Down Expand Up @@ -200,6 +213,21 @@ func (r *Manila) ValidateUpdate(old runtime.Object) (admission.Warnings, error)
func (spec *ManilaSpec) ValidateUpdate(old ManilaSpec, basePath *field.Path, namespace string) field.ErrorList {
var allErrs field.ErrorList

// Reject changes to deprecated RabbitMqClusterName field - users should use the new messagingBus.cluster field instead
if spec.RabbitMqClusterName != old.RabbitMqClusterName {
allErrs = append(allErrs, field.Forbidden(
basePath.Child("rabbitMqClusterName"),
"rabbitMqClusterName is deprecated and cannot be changed. Please use messagingBus.cluster instead"))
}

// Reject changes to deprecated NotificationsBusInstance field
if spec.NotificationsBusInstance != nil && old.NotificationsBusInstance != nil &&
*spec.NotificationsBusInstance != *old.NotificationsBusInstance {
allErrs = append(allErrs, field.Forbidden(
basePath.Child("notificationsBusInstance"),
"notificationsBusInstance is deprecated and cannot be changed. Please use notificationsBus.cluster instead"))
}

// validate the service base parameters
allErrs = append(allErrs, spec.ValidateBaseParams(basePath)...)

Expand All @@ -217,6 +245,21 @@ func (spec *ManilaSpec) ValidateUpdate(old ManilaSpec, basePath *field.Path, nam
func (spec *ManilaSpecCore) ValidateUpdate(old ManilaSpecCore, basePath *field.Path, namespace string) field.ErrorList {
var allErrs field.ErrorList

// Reject changes to deprecated RabbitMqClusterName field - users should use the new messagingBus.cluster field instead
if spec.RabbitMqClusterName != old.RabbitMqClusterName {
allErrs = append(allErrs, field.Forbidden(
basePath.Child("rabbitMqClusterName"),
"rabbitMqClusterName is deprecated and cannot be changed. Please use messagingBus.cluster instead"))
}

// Reject changes to deprecated NotificationsBusInstance field
if spec.NotificationsBusInstance != nil && old.NotificationsBusInstance != nil &&
*spec.NotificationsBusInstance != *old.NotificationsBusInstance {
allErrs = append(allErrs, field.Forbidden(
basePath.Child("notificationsBusInstance"),
"notificationsBusInstance is deprecated and cannot be changed. Please use notificationsBus.cluster instead"))
}

// validate the service base parameters
allErrs = append(allErrs, spec.ValidateBaseParams(basePath)...)

Expand Down
7 changes: 7 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions config/crd/bases/manila.openstack.org_manilas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,22 @@ spec:
default: memcached
description: Memcached instance name.
type: string
messagingBus:
description: MessagingBus configuration (username, vhost, and cluster)
properties:
cluster:
description: Name of the cluster
minLength: 1
type: string
user:
description: User - RabbitMQ username
type: string
vhost:
description: Vhost - RabbitMQ vhost name
type: string
required:
- cluster
type: object
nodeSelector:
additionalProperties:
type: string
Expand All @@ -1796,6 +1812,23 @@ spec:
NodeSelector here acts as a default value and can be overridden by service
specific NodeSelector Settings.
type: object
notificationsBus:
description: NotificationsBus configuration (username, vhost, and
cluster) for notifications
properties:
cluster:
description: Name of the cluster
minLength: 1
type: string
user:
description: User - RabbitMQ username
type: string
vhost:
description: Vhost - RabbitMQ vhost name
type: string
required:
- cluster
type: object
notificationsBusInstance:
description: |-
RabbitMQ instance name used to request a transportURL that is used for
Expand Down
34 changes: 34 additions & 0 deletions config/samples/manila_v1beta1_manila_rabbitmq_custom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: manila.openstack.org/v1beta1
kind: Manila
metadata:
name: manila-rabbitmq-custom
namespace: openstack
spec:
secret: osp-secret
databaseInstance: openstack
databaseAccount: manila
rabbitMqClusterName: rabbitmq
# Custom RabbitMQ configuration for the main messaging bus
rabbitmq:
user: main-user
vhost: main-vhost
# Optional: Separate RabbitMQ configuration for notifications
notificationsBusInstance: rabbitmq-notification
notificationsRabbitmq:
user: notifications-user
vhost: notifications-vhost
memcachedInstance: memcached
serviceUser: manila
customServiceConfig: |
[DEFAULT]
debug = true
manilaAPI:
replicas: 1
containerImage: quay.io/podified-antelope-centos9/openstack-manila-api:current-podified
manilaScheduler:
replicas: 1
containerImage: quay.io/podified-antelope-centos9/openstack-manila-scheduler:current-podified
manilaShares:
share0:
replicas: 1
containerImage: quay.io/podified-antelope-centos9/openstack-manila-share:current-podified
Loading