Skip to content

Commit e19dcc6

Browse files
committed
Add support for Glance Location API configuration in OpenStack operator
This change integrates the Glance Location API feature exposed by Glance. It enables "single" GlanceAPI StatefulSet deployments with regular backends for RHOSO 19, and it reduces the PVC resource requirements, resulting in a simplified deployment topology. The Location API is controlled via the "glance.openstack.org/location-api" annotation in the Glance CR for backward compatibility, allowing existing deployments to continue to work with the split method while enabling the new single-API deployment model for new (19 based) setups. Signed-off-by: Francesco Pantano <fpantano@redhat.com>
1 parent ed19ffe commit e19dcc6

12 files changed

+36
-11
lines changed

api/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4658,7 +4658,7 @@ spec:
46584658
type: string
46594659
type: object
46604660
type:
4661-
default: split
4661+
default: single
46624662
enum:
46634663
- split
46644664
- single

api/bases/core.openstack.org_openstackversions.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ spec:
248248
availableServiceDefaults:
249249
additionalProperties:
250250
properties:
251+
glanceLocationAPI:
252+
type: string
251253
glanceWsgi:
252254
type: string
253255
type: object
@@ -683,6 +685,8 @@ spec:
683685
type: integer
684686
serviceDefaults:
685687
properties:
688+
glanceLocationAPI:
689+
type: string
686690
glanceWsgi:
687691
type: string
688692
type: object

api/core/v1beta1/openstackversion_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ type ContainerTemplate struct {
178178
// but are associated with a specific OpenStack release version
179179
type ServiceDefaults struct {
180180
GlanceWsgi *string `json:"glanceWsgi,omitempty"`
181+
GlanceLocationAPI *string `json:"glanceLocationAPI,omitempty"`
181182
}
182183

183184
// OpenStackVersionStatus defines the observed state of OpenStackVersion

api/core/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.

bindata/crds/crds.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4923,7 +4923,7 @@ spec:
49234923
type: string
49244924
type: object
49254925
type:
4926-
default: split
4926+
default: single
49274927
enum:
49284928
- split
49294929
- single
@@ -21459,6 +21459,8 @@ spec:
2145921459
availableServiceDefaults:
2146021460
additionalProperties:
2146121461
properties:
21462+
glanceLocationAPI:
21463+
type: string
2146221464
glanceWsgi:
2146321465
type: string
2146421466
type: object
@@ -21894,6 +21896,8 @@ spec:
2189421896
type: integer
2189521897
serviceDefaults:
2189621898
properties:
21899+
glanceLocationAPI:
21900+
type: string
2189721901
glanceWsgi:
2189821902
type: string
2189921903
type: object

bindata/crds/glance.openstack.org_glanceapis.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ spec:
5858
minimum: 1
5959
type: integer
6060
apiType:
61-
default: external
61+
default: single
6262
enum:
6363
- internal
6464
- external
@@ -1581,7 +1581,7 @@ spec:
15811581
type: string
15821582
type: object
15831583
type:
1584-
default: split
1584+
default: single
15851585
description: Type - represents the layout of the glanceAPI deployment.
15861586
enum:
15871587
- split

bindata/crds/glance.openstack.org_glances.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ spec:
15751575
type: string
15761576
type: object
15771577
type:
1578-
default: split
1578+
default: single
15791579
description: Type - represents the layout of the glanceAPI deployment.
15801580
enum:
15811581
- split

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4658,7 +4658,7 @@ spec:
46584658
type: string
46594659
type: object
46604660
type:
4661-
default: split
4661+
default: single
46624662
enum:
46634663
- split
46644664
- single

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ spec:
248248
availableServiceDefaults:
249249
additionalProperties:
250250
properties:
251+
glanceLocationAPI:
252+
type: string
251253
glanceWsgi:
252254
type: string
253255
type: object
@@ -683,6 +685,8 @@ spec:
683685
type: integer
684686
serviceDefaults:
685687
properties:
688+
glanceLocationAPI:
689+
type: string
686690
glanceWsgi:
687691
type: string
688692
type: object

internal/openstack/glance.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ func ReconcileGlance(ctx context.Context, instance *corev1beta1.OpenStackControl
271271
} else {
272272
glance.GetAnnotations()[glancev1.GlanceWSGILabel] = "false"
273273
}
274+
if version.Status.ServiceDefaults.GlanceLocationAPI != nil && *version.Status.ServiceDefaults.GlanceLocationAPI == "true" {
275+
glance.GetAnnotations()[glancev1.GlanceLocationAPILabel] = "true"
276+
} else {
277+
glance.GetAnnotations()[glancev1.GlanceLocationAPILabel] = "false"
278+
}
274279

275280
// Append globally defined extraMounts to the service's own list.
276281
for _, ev := range instance.Spec.ExtraMounts {

0 commit comments

Comments
 (0)