Skip to content

Commit

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

Jira: OSP-26690
  • Loading branch information
stuggi committed Aug 17, 2023
1 parent a53bfea commit 8d31781
Show file tree
Hide file tree
Showing 9 changed files with 293 additions and 4 deletions.
105 changes: 103 additions & 2 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3937,6 +3937,107 @@ spec:
type: object
horizon:
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 Expand Up @@ -3967,7 +4068,7 @@ spec:
override:
properties:
service:
items:
additionalProperties:
properties:
endpointURL:
type: string
Expand Down Expand Up @@ -4013,7 +4114,7 @@ spec:
type: string
type: object
type: object
type: array
type: object
type: object
preserveJobs:
default: false
Expand Down
12 changes: 12 additions & 0 deletions apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,18 @@ type HorizonSection struct {
// +kubebuilder:validation:Optional
// Template - Overrides to use when creating the Horizon services
Template horizonv1.HorizonSpec `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 HorizonOverride `json:"apiOverride,omitempty"`
}

// HorizonOverride to override the generated manifest of several child resources.
type HorizonOverride struct {
// +kubebuilder:validation:Optional
// Route overrides to use when creating the public service endpoint
Route *route.OverrideSpec `json:"route,omitempty"`
}

// CeilometerSection defines the desired state of OpenStack Telemetry services
Expand Down
21 changes: 21 additions & 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.

105 changes: 103 additions & 2 deletions config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3937,6 +3937,107 @@ spec:
type: object
horizon:
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 Expand Up @@ -3967,7 +4068,7 @@ spec:
override:
properties:
service:
items:
additionalProperties:
properties:
endpointURL:
type: string
Expand Down Expand Up @@ -4013,7 +4114,7 @@ spec:
type: string
type: object
type: object
type: array
type: object
type: object
preserveJobs:
default: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ spec:
networkAttachments:
- internalapi
horizon:
apiOverride:
route: {}
template:
replicas: 1
secret: osp-secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ spec:
networkAttachments:
- internalapi
horizon:
apiOverride:
route: {}
template:
replicas: 1
secret: osp-secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ spec:
networkAttachments:
- internalapi
horizon:
apiOverride:
route: {}
template:
replicas: 1
secret: osp-secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ spec:
networkAttachments:
- internalapi
horizon:
apiOverride:
route: {}
template:
replicas: 1
secret: osp-secret
Expand Down
Loading

0 comments on commit 8d31781

Please sign in to comment.