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 Aug 16, 2023
1 parent 6ca6531 commit 5652f07
Show file tree
Hide file tree
Showing 14 changed files with 324 additions and 26 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 @@ -2107,6 +2107,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
5 changes: 5 additions & 0 deletions apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,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.

2 changes: 1 addition & 1 deletion apis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ replace github.com/openstack-k8s-operators/lib-common/modules/common => github.c

replace github.com/openstack-k8s-operators/keystone-operator/api => github.com/stuggi/keystone-operator/api v0.0.0-20230816122109-152862232878

replace github.com/openstack-k8s-operators/glance-operator/api => github.com/stuggi/glance-operator/api v0.0.0-20230809094131-22913c6b4f1c
replace github.com/openstack-k8s-operators/glance-operator/api => github.com/stuggi/glance-operator/api v0.0.0-20230816132821-d39a79afee8a

replace github.com/openstack-k8s-operators/placement-operator/api => github.com/stuggi/placement-operator/api v0.0.0-20230816134701-bfcdc098dab0

Expand Down
4 changes: 2 additions & 2 deletions apis/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stuggi/cinder-operator/api v0.0.0-20230816140403-a075c26418b4 h1:AvmYgD3dsdc+gQ772Uvtnm1/iyRXH4o6DcJyFzJMy60=
github.com/stuggi/cinder-operator/api v0.0.0-20230816140403-a075c26418b4/go.mod h1:3xQfQGmIzZeufZOpAuOe9i0pTSoxYvz0JsdAJjK2Kno=
github.com/stuggi/glance-operator/api v0.0.0-20230809094131-22913c6b4f1c h1:u4wDtY6wQNDV1RxhMfOwd85/lG5SzVm61Jemm9dHf0w=
github.com/stuggi/glance-operator/api v0.0.0-20230809094131-22913c6b4f1c/go.mod h1:2Dfm01p6uGeQF8rsMKz6qQRPxZCLNLKuT5Flju5jSB4=
github.com/stuggi/glance-operator/api v0.0.0-20230816132821-d39a79afee8a h1:sttkHGsZRdsXfKgVJA4LOc5wJOboeZ3U7YpDROUFinM=
github.com/stuggi/glance-operator/api v0.0.0-20230816132821-d39a79afee8a/go.mod h1:NXBA6L/qHCAxh5onMhv88fT1c/pZ3UXbr1eHr62CHQ8=
github.com/stuggi/heat-operator/api v0.0.0-20230816145353-b17691c6b5f0 h1:NcsIDs5+Clt3DIFWlbhyBAAuslkY2ZF2Wpp6tT5vHa8=
github.com/stuggi/heat-operator/api v0.0.0-20230816145353-b17691c6b5f0/go.mod h1:N3SRs4S/P1qqqjuje/6LupaqN5swXDDUlyRp9jSAJs8=
github.com/stuggi/horizon-operator/api v0.0.0-20230816150035-5dfe29c00383 h1:FRPiUDdHOIKVT6xtv6gJucl/YlReAz0CiuhAGQa+PAQ=
Expand Down
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 @@ -2107,6 +2107,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 @@ -81,6 +81,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 @@ -38,16 +38,17 @@ spec:
- storage
replicas: 0 # backend needs to be configured
glance:
apiOverride:
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
template:
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
glanceAPIInternal:
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
networkAttachments:
- storage
glanceAPIExternal:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@ spec:
- storage
replicas: 0 # backend needs to be configured
glance:
apiOverride:
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
template:
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
glanceAPIInternal:
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
networkAttachments:
- storage
glanceAPIExternal:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,22 @@ 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:
annotations:
metallb.universe.tf/address-pool: internalapi
metallb.universe.tf/allow-shared-ip: internalapi
metallb.universe.tf/loadBalancerIPs: 172.17.0.80
spec:
type: LoadBalancer
networkAttachments:
- storage
glanceAPIExternal:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ spec:
- storage
replicas: 0 # backend needs to be configured
glance:
apiOverride:
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
template:
databaseInstance: openstack
customServiceConfig: |
Expand All @@ -87,11 +93,6 @@ spec:
storageClass: ""
storageRequest: 10G
glanceAPIInternal:
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
networkAttachments:
- storage
glanceAPIExternal:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ replace github.com/openstack-k8s-operators/lib-common/modules/common => github.c

replace github.com/openstack-k8s-operators/keystone-operator/api => github.com/stuggi/keystone-operator/api v0.0.0-20230816122109-152862232878

replace github.com/openstack-k8s-operators/glance-operator/api => github.com/stuggi/glance-operator/api v0.0.0-20230809094131-22913c6b4f1c
replace github.com/openstack-k8s-operators/glance-operator/api => github.com/stuggi/glance-operator/api v0.0.0-20230816132821-d39a79afee8a

replace github.com/openstack-k8s-operators/placement-operator/api => github.com/stuggi/placement-operator/api v0.0.0-20230816134701-bfcdc098dab0

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stuggi/cinder-operator/api v0.0.0-20230816140403-a075c26418b4 h1:AvmYgD3dsdc+gQ772Uvtnm1/iyRXH4o6DcJyFzJMy60=
github.com/stuggi/cinder-operator/api v0.0.0-20230816140403-a075c26418b4/go.mod h1:3xQfQGmIzZeufZOpAuOe9i0pTSoxYvz0JsdAJjK2Kno=
github.com/stuggi/glance-operator/api v0.0.0-20230809094131-22913c6b4f1c h1:u4wDtY6wQNDV1RxhMfOwd85/lG5SzVm61Jemm9dHf0w=
github.com/stuggi/glance-operator/api v0.0.0-20230809094131-22913c6b4f1c/go.mod h1:2Dfm01p6uGeQF8rsMKz6qQRPxZCLNLKuT5Flju5jSB4=
github.com/stuggi/glance-operator/api v0.0.0-20230816132821-d39a79afee8a h1:sttkHGsZRdsXfKgVJA4LOc5wJOboeZ3U7YpDROUFinM=
github.com/stuggi/glance-operator/api v0.0.0-20230816132821-d39a79afee8a/go.mod h1:NXBA6L/qHCAxh5onMhv88fT1c/pZ3UXbr1eHr62CHQ8=
github.com/stuggi/heat-operator/api v0.0.0-20230816145353-b17691c6b5f0 h1:NcsIDs5+Clt3DIFWlbhyBAAuslkY2ZF2Wpp6tT5vHa8=
github.com/stuggi/heat-operator/api v0.0.0-20230816145353-b17691c6b5f0/go.mod h1:N3SRs4S/P1qqqjuje/6LupaqN5swXDDUlyRp9jSAJs8=
github.com/stuggi/horizon-operator/api v0.0.0-20230816150035-5dfe29c00383 h1:FRPiUDdHOIKVT6xtv6gJucl/YlReAz0CiuhAGQa+PAQ=
Expand Down
Loading

0 comments on commit 5652f07

Please sign in to comment.