Skip to content

Commit 0f27b56

Browse files
authored
Request TransportURL when deploying Cinder (#62)
Use `TransportURL` CR to ask for the `transport_url` value needed to configure Cinder. The openstack-operator waits for RabbitMQ to be ready and then creates a secret and fills the `TransportURL` status field.
1 parent 72f7cd5 commit 0f27b56

36 files changed

+419
-379
lines changed

api/bases/cinder.openstack.org_cinderapis.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ spec:
8888
default:
8989
database: CinderDatabasePassword
9090
service: CinderPassword
91-
transportUrl: TransportURL
9291
description: PasswordSelectors - Selectors to identify the DB and
93-
ServiceUser password and TransportURL from the Secret
92+
ServiceUser password from the Secret
9493
properties:
9594
database:
9695
default: CinderDatabasePassword
@@ -99,12 +98,7 @@ spec:
9998
type: string
10099
service:
101100
default: CinderPassword
102-
description: Database - Selector to get the cinder service password
103-
from the Secret
104-
type: string
105-
transportUrl:
106-
default: TransportURL
107-
description: Database - Selector to get the cinder service password
101+
description: Service - Selector to get the cinder service password
108102
from the Secret
109103
type: string
110104
type: object
@@ -149,6 +143,9 @@ spec:
149143
description: ServiceUser - optional username used for this service
150144
to register in cinder
151145
type: string
146+
transportURLSecret:
147+
description: Secret containing RabbitMq transport URL
148+
type: string
152149
type: object
153150
status:
154151
description: CinderAPIStatus defines the observed state of CinderAPI

api/bases/cinder.openstack.org_cinderbackups.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ spec:
8888
default:
8989
database: CinderDatabasePassword
9090
service: CinderPassword
91-
transportUrl: TransportURL
9291
description: PasswordSelectors - Selectors to identify the DB and
93-
ServiceUser password and TransportURL from the Secret
92+
ServiceUser password from the Secret
9493
properties:
9594
database:
9695
default: CinderDatabasePassword
@@ -99,12 +98,7 @@ spec:
9998
type: string
10099
service:
101100
default: CinderPassword
102-
description: Database - Selector to get the cinder service password
103-
from the Secret
104-
type: string
105-
transportUrl:
106-
default: TransportURL
107-
description: Database - Selector to get the cinder service password
101+
description: Service - Selector to get the cinder service password
108102
from the Secret
109103
type: string
110104
type: object
@@ -148,6 +142,9 @@ spec:
148142
description: ServiceUser - optional username used for this service
149143
to register in cinder
150144
type: string
145+
transportURLSecret:
146+
description: Secret containing RabbitMq transport URL
147+
type: string
151148
type: object
152149
status:
153150
description: CinderBackupStatus defines the observed state of CinderBackup

api/bases/cinder.openstack.org_cinders.yaml

Lines changed: 31 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ spec:
136136
default:
137137
database: CinderDatabasePassword
138138
service: CinderPassword
139-
transportUrl: TransportURL
140139
description: PasswordSelectors - Selectors to identify the DB
141-
and ServiceUser password and TransportURL from the Secret
140+
and ServiceUser password from the Secret
142141
properties:
143142
database:
144143
default: CinderDatabasePassword
@@ -148,12 +147,7 @@ spec:
148147
type: string
149148
service:
150149
default: CinderPassword
151-
description: Database - Selector to get the cinder service
152-
password from the Secret
153-
type: string
154-
transportUrl:
155-
default: TransportURL
156-
description: Database - Selector to get the cinder service
150+
description: Service - Selector to get the cinder service
157151
password from the Secret
158152
type: string
159153
type: object
@@ -198,6 +192,9 @@ spec:
198192
description: ServiceUser - optional username used for this service
199193
to register in cinder
200194
type: string
195+
transportURLSecret:
196+
description: Secret containing RabbitMq transport URL
197+
type: string
201198
type: object
202199
cinderBackup:
203200
description: CinderBackup - Spec definition for the Backup service
@@ -256,9 +253,8 @@ spec:
256253
default:
257254
database: CinderDatabasePassword
258255
service: CinderPassword
259-
transportUrl: TransportURL
260256
description: PasswordSelectors - Selectors to identify the DB
261-
and ServiceUser password and TransportURL from the Secret
257+
and ServiceUser password from the Secret
262258
properties:
263259
database:
264260
default: CinderDatabasePassword
@@ -268,12 +264,7 @@ spec:
268264
type: string
269265
service:
270266
default: CinderPassword
271-
description: Database - Selector to get the cinder service
272-
password from the Secret
273-
type: string
274-
transportUrl:
275-
default: TransportURL
276-
description: Database - Selector to get the cinder service
267+
description: Service - Selector to get the cinder service
277268
password from the Secret
278269
type: string
279270
type: object
@@ -317,6 +308,9 @@ spec:
317308
description: ServiceUser - optional username used for this service
318309
to register in cinder
319310
type: string
311+
transportURLSecret:
312+
description: Secret containing RabbitMq transport URL
313+
type: string
320314
type: object
321315
cinderScheduler:
322316
description: CinderScheduler - Spec definition for the Scheduler service
@@ -376,9 +370,8 @@ spec:
376370
default:
377371
database: CinderDatabasePassword
378372
service: CinderPassword
379-
transportUrl: TransportURL
380373
description: PasswordSelectors - Selectors to identify the DB
381-
and ServiceUser password and TransportURL from the Secret
374+
and ServiceUser password from the Secret
382375
properties:
383376
database:
384377
default: CinderDatabasePassword
@@ -388,12 +381,7 @@ spec:
388381
type: string
389382
service:
390383
default: CinderPassword
391-
description: Database - Selector to get the cinder service
392-
password from the Secret
393-
type: string
394-
transportUrl:
395-
default: TransportURL
396-
description: Database - Selector to get the cinder service
384+
description: Service - Selector to get the cinder service
397385
password from the Secret
398386
type: string
399387
type: object
@@ -438,6 +426,9 @@ spec:
438426
description: ServiceUser - optional username used for this service
439427
to register in cinder
440428
type: string
429+
transportURLSecret:
430+
description: Secret containing RabbitMq transport URL
431+
type: string
441432
type: object
442433
cinderVolumes:
443434
additionalProperties:
@@ -497,9 +488,8 @@ spec:
497488
default:
498489
database: CinderDatabasePassword
499490
service: CinderPassword
500-
transportUrl: TransportURL
501491
description: PasswordSelectors - Selectors to identify the DB
502-
and ServiceUser password and TransportURL from the Secret
492+
and ServiceUser password from the Secret
503493
properties:
504494
database:
505495
default: CinderDatabasePassword
@@ -509,12 +499,7 @@ spec:
509499
type: string
510500
service:
511501
default: CinderPassword
512-
description: Database - Selector to get the cinder service
513-
password from the Secret
514-
type: string
515-
transportUrl:
516-
default: TransportURL
517-
description: Database - Selector to get the cinder service
502+
description: Service - Selector to get the cinder service
518503
password from the Secret
519504
type: string
520505
type: object
@@ -561,6 +546,9 @@ spec:
561546
description: ServiceUser - optional username used for this service
562547
to register in cinder
563548
type: string
549+
transportURLSecret:
550+
description: Secret containing RabbitMq transport URL
551+
type: string
564552
type: object
565553
description: CinderVolumes - Map of chosen names to spec definitions
566554
for the Volume(s) service(s) of this Cinder deployment
@@ -611,9 +599,8 @@ spec:
611599
default:
612600
database: CinderDatabasePassword
613601
service: CinderPassword
614-
transportUrl: TransportURL
615602
description: PasswordSelectors - Selectors to identify the DB and
616-
ServiceUser password and TransportURL from the Secret
603+
ServiceUser password from the Secret
617604
properties:
618605
database:
619606
default: CinderDatabasePassword
@@ -622,12 +609,7 @@ spec:
622609
type: string
623610
service:
624611
default: CinderPassword
625-
description: Database - Selector to get the cinder service password
626-
from the Secret
627-
type: string
628-
transportUrl:
629-
default: TransportURL
630-
description: Database - Selector to get the cinder service password
612+
description: Service - Selector to get the cinder service password
631613
from the Secret
632614
type: string
633615
type: object
@@ -636,6 +618,11 @@ spec:
636618
description: PreserveJobs - do not delete jobs after they finished
637619
e.g. to check logs
638620
type: boolean
621+
rabbitMqClusterName:
622+
default: rabbitmq
623+
description: RabbitMQ instance name Needed to request a transportURL
624+
that is created and used in Cinder
625+
type: string
639626
secret:
640627
description: Secret containing OpenStack password information for
641628
CinderDatabasePassword, CinderPassword
@@ -648,6 +635,7 @@ spec:
648635
required:
649636
- cinderAPI
650637
- cinderScheduler
638+
- rabbitMqClusterName
651639
type: object
652640
status:
653641
description: CinderStatus defines the observed state of Cinder
@@ -733,6 +721,9 @@ spec:
733721
type: string
734722
description: ServiceIDs
735723
type: object
724+
transportURLSecret:
725+
description: TransportURLSecret - Secret containing RabbitMQ transportURL
726+
type: string
736727
type: object
737728
type: object
738729
served: true

api/bases/cinder.openstack.org_cinderschedulers.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ spec:
8888
default:
8989
database: CinderDatabasePassword
9090
service: CinderPassword
91-
transportUrl: TransportURL
9291
description: PasswordSelectors - Selectors to identify the DB and
93-
ServiceUser password and TransportURL from the Secret
92+
ServiceUser password from the Secret
9493
properties:
9594
database:
9695
default: CinderDatabasePassword
@@ -99,12 +98,7 @@ spec:
9998
type: string
10099
service:
101100
default: CinderPassword
102-
description: Database - Selector to get the cinder service password
103-
from the Secret
104-
type: string
105-
transportUrl:
106-
default: TransportURL
107-
description: Database - Selector to get the cinder service password
101+
description: Service - Selector to get the cinder service password
108102
from the Secret
109103
type: string
110104
type: object
@@ -149,6 +143,9 @@ spec:
149143
description: ServiceUser - optional username used for this service
150144
to register in cinder
151145
type: string
146+
transportURLSecret:
147+
description: Secret containing RabbitMq transport URL
148+
type: string
152149
type: object
153150
status:
154151
description: CinderSchedulerStatus defines the observed state of CinderScheduler

api/bases/cinder.openstack.org_cindervolumes.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ spec:
8888
default:
8989
database: CinderDatabasePassword
9090
service: CinderPassword
91-
transportUrl: TransportURL
9291
description: PasswordSelectors - Selectors to identify the DB and
93-
ServiceUser password and TransportURL from the Secret
92+
ServiceUser password from the Secret
9493
properties:
9594
database:
9695
default: CinderDatabasePassword
@@ -99,12 +98,7 @@ spec:
9998
type: string
10099
service:
101100
default: CinderPassword
102-
description: Database - Selector to get the cinder service password
103-
from the Secret
104-
type: string
105-
transportUrl:
106-
default: TransportURL
107-
description: Database - Selector to get the cinder service password
101+
description: Service - Selector to get the cinder service password
108102
from the Secret
109103
type: string
110104
type: object
@@ -150,6 +144,9 @@ spec:
150144
description: ServiceUser - optional username used for this service
151145
to register in cinder
152146
type: string
147+
transportURLSecret:
148+
description: Secret containing RabbitMq transport URL
149+
type: string
153150
type: object
154151
status:
155152
description: CinderVolumeStatus defines the observed state of CinderVolume

api/go.mod

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,29 @@ module github.com/openstack-k8s-operators/cinder-operator/api
33
go 1.18
44

55
require (
6-
github.com/openstack-k8s-operators/lib-common/modules/common v0.0.0-20220923094431-9fca0c85a9dc
6+
github.com/openstack-k8s-operators/lib-common/modules/common v0.0.0-20221103175706-2c39582ce513
77
github.com/openstack-k8s-operators/lib-common/modules/storage v0.0.0-20220923094431-9fca0c85a9dc
8-
k8s.io/api v0.24.3
9-
k8s.io/apimachinery v0.24.3
10-
sigs.k8s.io/controller-runtime v0.12.3
8+
k8s.io/api v0.25.2
9+
k8s.io/apimachinery v0.25.2
10+
sigs.k8s.io/controller-runtime v0.13.0
1111
)
1212

1313
require (
1414
github.com/go-logr/logr v1.2.3 // indirect
1515
github.com/gogo/protobuf v1.3.2 // indirect
16-
github.com/google/gofuzz v1.1.0 // indirect
16+
github.com/google/go-cmp v0.5.9 // indirect
17+
github.com/google/gofuzz v1.2.0 // indirect
1718
github.com/json-iterator/go v1.1.12 // indirect
1819
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
1920
github.com/modern-go/reflect2 v1.0.2 // indirect
20-
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
21+
github.com/openstack-k8s-operators/openstack-operator/apis v0.0.0-20221107090218-8d63dba1ec13 // indirect
22+
golang.org/x/net v0.0.0-20221002022538-bcab6841153b // indirect
23+
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect
2124
golang.org/x/text v0.3.7 // indirect
2225
gopkg.in/inf.v0 v0.9.1 // indirect
2326
gopkg.in/yaml.v2 v2.4.0 // indirect
24-
k8s.io/klog/v2 v2.60.1 // indirect
25-
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
26-
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
27-
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
27+
k8s.io/klog/v2 v2.80.1 // indirect
28+
k8s.io/utils v0.0.0-20220922133306-665eaaec4324 // indirect
29+
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
30+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
2831
)

0 commit comments

Comments
 (0)