Skip to content

Commit ea54d97

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 3fd1765 commit ea54d97

12 files changed

Lines changed: 35 additions & 10 deletions

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
@@ -21468,6 +21468,8 @@ spec:
2146821468
availableServiceDefaults:
2146921469
additionalProperties:
2147021470
properties:
21471+
glanceLocationAPI:
21472+
type: string
2147121473
glanceWsgi:
2147221474
type: string
2147321475
type: object
@@ -21903,6 +21905,8 @@ spec:
2190321905
type: integer
2190421906
serviceDefaults:
2190521907
properties:
21908+
glanceLocationAPI:
21909+
type: string
2190621910
glanceWsgi:
2190721911
type: string
2190821912
type: object

bindata/crds/glance.openstack.org_glanceapis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)