Skip to content

Commit

Permalink
Update glanceapi to use service override
Browse files Browse the repository at this point in the history
Removes creation of routes.Those get done in the openstack-operator.
Via service overrides the service can be customized. The service operator
adds annotation to the service which needs to be exposed as a route.

Jira: OSP-26690

Depends-On: openstack-k8s-operators/lib-common#332
  • Loading branch information
stuggi committed Sep 20, 2023
1 parent 15e9a91 commit aa05d80
Show file tree
Hide file tree
Showing 19 changed files with 615 additions and 397 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ sh-5.1# ip a
## Example: expose Glance to an isolated network

The Glance spec can be used to configure Glance to register e.g.
the internal endpoint to an isolated network. MetalLB is used for this
the internal endpoint to an isolated network. MetalLB can be used for this
scenario.

As a pre requisite, MetalLB needs to be installed and worker nodes
Expand Down Expand Up @@ -413,13 +413,15 @@ spec:
...
glanceAPIInternal:
...
externalEndpoints:
- endpoint: internal
ipAddressPool: osp-internalapi
loadBalancerIPs:
- "172.17.0.202"
sharedIP: true
sharedIPKey: ""
override:
service:
metadata:
annotations:
metallb.universe.tf/address-pool: internalapi
metallb.universe.tf/allow-shared-ip: internalapi
metallb.universe.tf/loadBalancerIPs: 172.17.0.202
spec:
type: LoadBalancer
...
...
```
Expand Down
75 changes: 49 additions & 26 deletions api/bases/glance.openstack.org_glanceapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,32 +69,6 @@ spec:
additionalProperties:
type: string
type: object
externalEndpoints:
items:
properties:
endpoint:
enum:
- internal
- public
type: string
ipAddressPool:
minLength: 1
type: string
loadBalancerIPs:
items:
type: string
type: array
sharedIP:
default: true
type: boolean
sharedIPKey:
default: ""
type: string
required:
- endpoint
- ipAddressPool
type: object
type: array
extraMounts:
items:
properties:
Expand Down Expand Up @@ -859,6 +833,55 @@ spec:
additionalProperties:
type: string
type: object
override:
properties:
service:
properties:
endpointURL:
type: string
metadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
spec:
properties:
externalName:
type: string
externalTrafficPolicy:
type: string
internalTrafficPolicy:
type: string
ipFamilyPolicy:
type: string
loadBalancerClass:
type: string
loadBalancerSourceRanges:
items:
type: string
type: array
sessionAffinity:
type: string
sessionAffinityConfig:
properties:
clientIP:
properties:
timeoutSeconds:
format: int32
type: integer
type: object
type: object
type:
type: string
type: object
type: object
type: object
passwordSelectors:
default:
database: GlanceDatabasePassword
Expand Down
150 changes: 98 additions & 52 deletions api/bases/glance.openstack.org_glances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -835,32 +835,6 @@ spec:
additionalProperties:
type: string
type: object
externalEndpoints:
items:
properties:
endpoint:
enum:
- internal
- public
type: string
ipAddressPool:
minLength: 1
type: string
loadBalancerIPs:
items:
type: string
type: array
sharedIP:
default: true
type: boolean
sharedIPKey:
default: ""
type: string
required:
- endpoint
- ipAddressPool
type: object
type: array
networkAttachments:
items:
type: string
Expand All @@ -869,6 +843,55 @@ spec:
additionalProperties:
type: string
type: object
override:
properties:
service:
properties:
endpointURL:
type: string
metadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
spec:
properties:
externalName:
type: string
externalTrafficPolicy:
type: string
internalTrafficPolicy:
type: string
ipFamilyPolicy:
type: string
loadBalancerClass:
type: string
loadBalancerSourceRanges:
items:
type: string
type: array
sessionAffinity:
type: string
sessionAffinityConfig:
properties:
clientIP:
properties:
timeoutSeconds:
format: int32
type: integer
type: object
type: object
type:
type: string
type: object
type: object
type: object
pvc:
type: string
replicas:
Expand Down Expand Up @@ -931,32 +954,6 @@ spec:
additionalProperties:
type: string
type: object
externalEndpoints:
items:
properties:
endpoint:
enum:
- internal
- public
type: string
ipAddressPool:
minLength: 1
type: string
loadBalancerIPs:
items:
type: string
type: array
sharedIP:
default: true
type: boolean
sharedIPKey:
default: ""
type: string
required:
- endpoint
- ipAddressPool
type: object
type: array
networkAttachments:
items:
type: string
Expand All @@ -965,6 +962,55 @@ spec:
additionalProperties:
type: string
type: object
override:
properties:
service:
properties:
endpointURL:
type: string
metadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
spec:
properties:
externalName:
type: string
externalTrafficPolicy:
type: string
internalTrafficPolicy:
type: string
ipFamilyPolicy:
type: string
loadBalancerClass:
type: string
loadBalancerSourceRanges:
items:
type: string
type: array
sessionAffinity:
type: string
sessionAffinityConfig:
properties:
clientIP:
properties:
timeoutSeconds:
format: int32
type: integer
type: object
type: object
type:
type: string
type: object
type: object
type: object
pvc:
type: string
replicas:
Expand Down
20 changes: 9 additions & 11 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ go 1.19

require (
github.com/gophercloud/gophercloud v1.6.0
github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230830083045-d73d07cca617
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230824094610-976b18ca2875
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230824094610-976b18ca2875
github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230824094610-976b18ca2875
k8s.io/api v0.26.8
k8s.io/apimachinery v0.26.8
github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230920085319-92ae0260bbf3
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230919113507-d74c2f31d216
github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230919113507-d74c2f31d216
k8s.io/api v0.26.9
k8s.io/apimachinery v0.26.9
sigs.k8s.io/controller-runtime v0.14.6
)

Expand Down Expand Up @@ -39,7 +39,6 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/ginkgo/v2 v2.12.0 // indirect
github.com/openshift/api v3.9.0+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
Expand All @@ -53,16 +52,15 @@ require (
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.13.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.8 //indirect
k8s.io/client-go v0.26.8 //indirect
k8s.io/component-base v0.26.8 //indirect
k8s.io/apiextensions-apiserver v0.26.9 //indirect
k8s.io/client-go v0.26.9 //indirect
k8s.io/component-base v0.26.9 //indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230327201221-f5883ff37f0c //indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b //indirect
Expand Down
Loading

0 comments on commit aa05d80

Please sign in to comment.