Skip to content

Commit

Permalink
Create glanceapi route and svc endpoint overrides
Browse files Browse the repository at this point in the history
Creates the route for the glanceapi, also allows to customize the
route via override.

Generats the service override for the env with what is configured in
the externalEndpoints, or specified in the service template override.

Depends-On: openstack-k8s-operators/lib-common#313
Depends-On: openstack-k8s-operators/keystone-operator#289
Depends-On: openstack-k8s-operators/glance-operator#285

Jira: OSP-26690
  • Loading branch information
stuggi committed Sep 21, 2023
1 parent a4e6c74 commit 4f0b325
Show file tree
Hide file tree
Showing 11 changed files with 297 additions and 21 deletions.
101 changes: 101 additions & 0 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,107 @@ spec:
type: object
glance:
properties:
apiOverride:
properties:
route:
properties:
metadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
spec:
properties:
alternateBackends:
items:
properties:
kind:
enum:
- Service
- ""
type: string
name:
type: string
weight:
format: int32
maximum: 256
minimum: 0
type: integer
type: object
maxItems: 3
type: array
host:
maxLength: 253
pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$
type: string
path:
pattern: ^/
type: string
port:
properties:
targetPort:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
required:
- targetPort
type: object
subdomain:
maxLength: 253
pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$
type: string
tls:
properties:
caCertificate:
type: string
certificate:
type: string
destinationCACertificate:
type: string
insecureEdgeTerminationPolicy:
type: string
key:
type: string
termination:
enum:
- edge
- reencrypt
- passthrough
type: string
required:
- termination
type: object
to:
properties:
kind:
enum:
- Service
- ""
type: string
name:
type: string
weight:
format: int32
maximum: 256
minimum: 0
type: integer
type: object
wildcardPolicy:
enum:
- None
- Subdomain
- ""
type: string
type: object
type: object
type: object
enabled:
default: true
type: boolean
Expand Down
3 changes: 3 additions & 0 deletions apis/core/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ const (
// OpenStackControlPlaneGlanceReadyCondition Status=True condition which indicates if Glance is configured and operational
OpenStackControlPlaneGlanceReadyCondition condition.Type = "OpenStackControlPlaneGlanceReady"

// OpenStackControlPlaneExposeGlanceReadyCondition Status=True condition which indicates if Glance is exposed via a route
OpenStackControlPlaneExposeGlanceReadyCondition condition.Type = "OpenStackControlPlaneExposeGlanceReady"

// OpenStackControlPlaneCinderReadyCondition Status=True condition which indicates if Cinder is configured and operational
OpenStackControlPlaneCinderReadyCondition condition.Type = "OpenStackControlPlaneCinderReady"

Expand Down
5 changes: 5 additions & 0 deletions apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ type GlanceSection struct {
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Template - Overrides to use when creating the Glance Service
Template glancev1.GlanceSpec `json:"template,omitempty"`

// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec
// APIOverride, provides the ability to override the generated manifest of several child resources.
APIOverride Override `json:"apiOverride,omitempty"`
}

// CinderSection defines the desired state of Cinder service
Expand Down
1 change: 1 addition & 0 deletions apis/core/v1beta1/zz_generated.deepcopy.go

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

101 changes: 101 additions & 0 deletions config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,107 @@ spec:
type: object
glance:
properties:
apiOverride:
properties:
route:
properties:
metadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
spec:
properties:
alternateBackends:
items:
properties:
kind:
enum:
- Service
- ""
type: string
name:
type: string
weight:
format: int32
maximum: 256
minimum: 0
type: integer
type: object
maxItems: 3
type: array
host:
maxLength: 253
pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$
type: string
path:
pattern: ^/
type: string
port:
properties:
targetPort:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
required:
- targetPort
type: object
subdomain:
maxLength: 253
pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$
type: string
tls:
properties:
caCertificate:
type: string
certificate:
type: string
destinationCACertificate:
type: string
insecureEdgeTerminationPolicy:
type: string
key:
type: string
termination:
enum:
- edge
- reencrypt
- passthrough
type: string
required:
- termination
type: object
to:
properties:
kind:
enum:
- Service
- ""
type: string
name:
type: string
weight:
format: int32
maximum: 256
minimum: 0
type: integer
type: object
wildcardPolicy:
enum:
- None
- Subdomain
- ""
type: string
type: object
type: object
type: object
enabled:
default: true
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,24 @@ spec:
path: glance.enabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: IPAddressPool expose VIP via MetalLB on the IPAddressPool
displayName: IPAddress Pool
path: glance.externalEndpoints[0].ipAddressPool
- description: LoadBalancerIPs, request given IPs from the pool if available.
Using a list to allow dual stack (IPv4/IPv6) support
displayName: Load Balancer IPs
path: glance.externalEndpoints[0].loadBalancerIPs
- description: SharedIP if true, VIP/VIPs get shared with multiple services
displayName: Shared IP
path: glance.externalEndpoints[0].sharedIP
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: SharedIPKey specifies the sharing key which gets set as the annotation
on the LoadBalancer service. Services which share the same VIP must have
the same SharedIPKey. Defaults to the IPAddressPool if SharedIP is true,
but no SharedIPKey specified.
displayName: Shared IPKey
path: glance.externalEndpoints[0].sharedIPKey
- description: Template - Overrides to use when creating the Glance Service
displayName: Template
path: glance.template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,13 @@ spec:
- storage
replicas: 0 # backend needs to be configured
glance:
apiOverride:
route: {}
template:
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
glanceAPIInternal:
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
override:
service:
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,13 @@ spec:
- storage
replicas: 0 # backend needs to be configured
glance:
apiOverride:
route: {}
template:
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
glanceAPIInternal:
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
override:
service:
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,13 @@ spec:
- storage
replicas: 0 # backend needs to be configured
glance:
apiOverride:
route: {}
template:
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
glanceAPIInternal:
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
override:
service:
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ spec:
- storage
replicas: 0 # backend needs to be configured
glance:
apiOverride:
route: {}
template:
databaseInstance: openstack
customServiceConfig: |
Expand All @@ -107,11 +109,6 @@ spec:
storageClass: ""
storageRequest: 10G
glanceAPIInternal:
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
override:
service:
metadata:
Expand Down
Loading

0 comments on commit 4f0b325

Please sign in to comment.