Skip to content

Commit

Permalink
Update cinderapi 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 12, 2023
1 parent 0dc5afa commit fb46057
Show file tree
Hide file tree
Showing 16 changed files with 422 additions and 316 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,16 @@ spec:
...
cinderAPI:
...
externalEndpoints:
- endpoint: internal
ipAddressPool: osp-internalapi
loadBalancerIPs:
- 172.17.0.202
sharedIP: true
sharedIPKey: ""
override:
service:
internal:
metadata:
annotations:
metallb.universe.tf/address-pool: osp-internalapi
metallb.universe.tf/allow-shared-ip: internalapi
metallb.universe.tf/loadBalancerIPs: 172.17.0.202
spec:
type: LoadBalancer
...
...
```
Expand Down
77 changes: 51 additions & 26 deletions api/bases/cinder.openstack.org_cinderapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,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 @@ -853,6 +827,57 @@ spec:
additionalProperties:
type: string
type: object
override:
properties:
service:
additionalProperties:
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
type: object
passwordSelectors:
default:
database: CinderDatabasePassword
Expand Down
77 changes: 51 additions & 26 deletions api/bases/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,32 +56,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 @@ -90,6 +64,57 @@ spec:
additionalProperties:
type: string
type: object
override:
properties:
service:
additionalProperties:
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
type: object
replicas:
default: 1
format: int32
Expand Down
28 changes: 14 additions & 14 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.19

require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.8
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.0
github.com/onsi/gomega v1.27.10
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230824094610-976b18ca2875
github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.0
k8s.io/api v0.26.7
k8s.io/apimachinery v0.26.7
Expand All @@ -14,12 +14,12 @@ require (

require (
github.com/go-logr/zapr v1.2.3 // indirect
go.uber.org/zap v1.24.0 // indirect
go.uber.org/zap v1.25.0 // indirect
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
Expand All @@ -45,20 +45,18 @@ 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/openshift/api v3.9.0+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
Expand All @@ -70,9 +68,9 @@ require (
k8s.io/apiextensions-apiserver v0.26.7 //indirect
k8s.io/client-go v0.26.7 // indirect // indirect
k8s.io/component-base v0.26.7 //indirect
k8s.io/klog/v2 v2.80.1 // 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-20230711102312-30195339c3c7 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand All @@ -81,3 +79,5 @@ require (
// mschuppert: map to latest commit from release-4.13 tag
// must consistent within modules and service operators
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 //allow-merging

replace github.com/openstack-k8s-operators/lib-common/modules/common => github.com/stuggi/lib-common/modules/common v0.0.0-20230911170028-26ca518cd865
Loading

0 comments on commit fb46057

Please sign in to comment.