Skip to content

Commit

Permalink
Create swiftproxy route and svc overrides
Browse files Browse the repository at this point in the history
Creates the route for the swift, 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/swift-operator#43

Jira: OSP-26690
  • Loading branch information
stuggi committed Sep 7, 2023
1 parent 0eb823a commit ad50869
Show file tree
Hide file tree
Showing 9 changed files with 309 additions and 8 deletions.
109 changes: 105 additions & 4 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5830,7 +5830,7 @@ spec:
override:
properties:
service:
items:
additionalProperties:
properties:
endpointURL:
type: string
Expand Down Expand Up @@ -5876,7 +5876,7 @@ spec:
type: string
type: object
type: object
type: array
type: object
type: object
replicas:
default: 1
Expand Down Expand Up @@ -12708,6 +12708,107 @@ spec:
enabled:
default: true
type: boolean
proxyOverride:
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
template:
properties:
storageClass:
Expand All @@ -12725,7 +12826,7 @@ spec:
override:
properties:
service:
items:
additionalProperties:
properties:
endpointURL:
type: string
Expand Down Expand Up @@ -12771,7 +12872,7 @@ spec:
type: string
type: object
type: object
type: array
type: object
type: object
passwordSelectors:
default:
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 @@ -120,6 +120,9 @@ const (
// OpenStackControlPlaneSwiftReadyCondition Status=True condition which indicates if Swift is configured and operational
OpenStackControlPlaneSwiftReadyCondition condition.Type = "OpenStackControlPlaneSwiftReady"

// OpenStackControlPlaneExposeSwiftReadyCondition Status=True condition which indicates if Swift is exposed via a route
OpenStackControlPlaneExposeSwiftReadyCondition condition.Type = "OpenStackControlPlaneExposeSwiftReady"

// OpenStackControlPlaneSwiftReadyInitMessage
OpenStackControlPlaneSwiftReadyInitMessage = "OpenStackControlPlane Swift not started"

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 @@ -553,6 +553,11 @@ type SwiftSection struct {
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Template - Overrides to use when creating Swift Resources
Template swiftv1.SwiftSpec `json:"template,omitempty"`

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

// OctaviaSection defines the desired state of the Octavia 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.

109 changes: 105 additions & 4 deletions config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5830,7 +5830,7 @@ spec:
override:
properties:
service:
items:
additionalProperties:
properties:
endpointURL:
type: string
Expand Down Expand Up @@ -5876,7 +5876,7 @@ spec:
type: string
type: object
type: object
type: array
type: object
type: object
replicas:
default: 1
Expand Down Expand Up @@ -12708,6 +12708,107 @@ spec:
enabled:
default: true
type: boolean
proxyOverride:
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
template:
properties:
storageClass:
Expand All @@ -12725,7 +12826,7 @@ spec:
override:
properties:
service:
items:
additionalProperties:
properties:
endpointURL:
type: string
Expand Down Expand Up @@ -12771,7 +12872,7 @@ spec:
type: string
type: object
type: object
type: array
type: object
type: object
passwordSelectors:
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,25 @@ spec:
serviceUser: ceilometer
swift:
enabled: true
proxyOverride:
route: {}
template:
swiftRing:
ringReplicas: 1
swiftStorage:
replicas: 1
swiftProxy:
replicas: 1
override:
service:
internal:
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
octavia:
enabled: false
template:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,25 @@ spec:
serviceUser: ceilometer
swift:
enabled: true
proxyOverride:
route: {}
template:
swiftRing:
ringReplicas: 1
swiftStorage:
replicas: 1
swiftProxy:
replicas: 1
override:
service:
internal:
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
octavia:
enabled: false
template:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,25 @@ spec:
serviceUser: ceilometer
swift:
enabled: true
proxyOverride:
route: {}
template:
swiftRing:
ringReplicas: 1
swiftStorage:
replicas: 1
swiftProxy:
replicas: 1
override:
service:
internal:
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
octavia:
enabled: false
template:
Expand Down
Loading

0 comments on commit ad50869

Please sign in to comment.