Skip to content

Commit

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

Jira: OSP-26690
  • Loading branch information
stuggi committed Sep 7, 2023
1 parent fe5e554 commit 0eb823a
Show file tree
Hide file tree
Showing 10 changed files with 305 additions and 20 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 @@ -4912,6 +4912,107 @@ spec:
type: object
manila:
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: false
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 @@ -93,6 +93,9 @@ const (
// OpenStackControlPlaneManilaReadyCondition Status=True condition which indicates if Manila is configured and operational
OpenStackControlPlaneManilaReadyCondition condition.Type = "OpenStackControlPlaneManilaReady"

// OpenStackControlPlaneExposeManilaReadyCondition Status=True condition which indicates if Manila is exposed via a route
OpenStackControlPlaneExposeManilaReadyCondition condition.Type = "OpenStackControlPlaneExposeManilaReady"

// OpenStackControlPlaneDNSReadyCondition Status=True condition which indicates if DNSMasq is configured and operational
OpenStackControlPlaneDNSReadyCondition condition.Type = "OpenStackControlPlaneDNSReadyCondition"

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 @@ -496,6 +496,11 @@ type ManilaSection struct {
// +kubebuilder:validation:Optional
// Template - Overrides to use when creating Manila Resources
Template manilav1.ManilaSpec `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"`
}

// HorizonSection defines the desired state of Horizon services
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 @@ -4912,6 +4912,107 @@ spec:
type: object
manila:
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: false
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,23 @@ spec:
type: LoadBalancer
secret: osp-secret
manila:
apiOverride:
route: {}
template:
manilaAPI:
replicas: 1
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
networkAttachments:
- internalapi
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
manilaScheduler:
replicas: 1
networkAttachments:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,23 @@ spec:
type: LoadBalancer
secret: osp-secret
manila:
apiOverride:
route: {}
template:
manilaAPI:
replicas: 1
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
networkAttachments:
- internalapi
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
manilaScheduler:
replicas: 1
networkAttachments:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,23 @@ spec:
type: LoadBalancer
secret: osp-secret
manila:
apiOverride:
route: {}
template:
manilaAPI:
replicas: 1
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
networkAttachments:
- internalapi
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
manilaScheduler:
replicas: 1
networkAttachments:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,23 @@ spec:
type: LoadBalancer
secret: osp-secret
manila:
apiOverride:
route: {}
template:
manilaAPI:
replicas: 1
externalEndpoints:
- endpoint: internal
ipAddressPool: internalapi
loadBalancerIPs:
- 172.17.0.80
networkAttachments:
- internalapi
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
manilaScheduler:
replicas: 1
networkAttachments:
Expand Down
Loading

0 comments on commit 0eb823a

Please sign in to comment.