Skip to content

Commit

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

Jira: OSP-26690
  • Loading branch information
stuggi committed Aug 7, 2023
1 parent 1140ee0 commit ab42cce
Show file tree
Hide file tree
Showing 10 changed files with 671 additions and 73 deletions.
270 changes: 244 additions & 26 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7522,6 +7522,133 @@ spec:
enabled:
default: true
type: boolean
externalEndpoints:
items:
properties:
endpoint:
default: internal
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:
- ipAddressPool
type: object
type: array
override:
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:
containerImage:
Expand All @@ -7546,32 +7673,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 @@ -7580,6 +7681,123 @@ spec:
additionalProperties:
type: string
type: object
override:
properties:
service:
items:
properties:
endpoint:
enum:
- internal
- public
type: string
endpointURL:
type: string
metadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
spec:
properties:
allocateLoadBalancerNodePorts:
type: boolean
clusterIP:
type: string
clusterIPs:
items:
type: string
type: array
x-kubernetes-list-type: atomic
externalIPs:
items:
type: string
type: array
externalName:
type: string
externalTrafficPolicy:
type: string
healthCheckNodePort:
format: int32
type: integer
internalTrafficPolicy:
type: string
ipFamilies:
items:
type: string
type: array
x-kubernetes-list-type: atomic
ipFamilyPolicy:
type: string
loadBalancerClass:
type: string
loadBalancerIP:
type: string
loadBalancerSourceRanges:
items:
type: string
type: array
ports:
items:
properties:
appProtocol:
type: string
name:
type: string
nodePort:
format: int32
type: integer
port:
format: int32
type: integer
protocol:
default: TCP
type: string
targetPort:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
required:
- port
type: object
type: array
x-kubernetes-list-map-keys:
- port
- protocol
x-kubernetes-list-type: map
publishNotReadyAddresses:
type: boolean
selector:
additionalProperties:
type: string
type: object
x-kubernetes-map-type: atomic
sessionAffinity:
type: string
sessionAffinityConfig:
properties:
clientIP:
properties:
timeoutSeconds:
format: int32
type: integer
type: object
type: object
type:
type: string
type: object
required:
- endpoint
type: object
type: array
type: object
passwordSelectors:
default:
database: PlacementDatabasePassword
Expand Down
14 changes: 13 additions & 1 deletion apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ import (
mariadbv1 "github.com/openstack-k8s-operators/mariadb-operator/api/v1beta1"
neutronv1 "github.com/openstack-k8s-operators/neutron-operator/api/v1beta1"
novav1 "github.com/openstack-k8s-operators/nova-operator/api/v1beta1"
octaviav1 "github.com/openstack-k8s-operators/octavia-operator/api/v1beta1"
ovnv1 "github.com/openstack-k8s-operators/ovn-operator/api/v1beta1"
placementv1 "github.com/openstack-k8s-operators/placement-operator/api/v1beta1"
swiftv1 "github.com/openstack-k8s-operators/swift-operator/api/v1beta1"
telemetryv1 "github.com/openstack-k8s-operators/telemetry-operator/api/v1beta1"
rabbitmqv1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
octaviav1 "github.com/openstack-k8s-operators/octavia-operator/api/v1beta1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -220,6 +220,18 @@ type PlacementSection struct {
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Template - Overrides to use when creating the Placement API
Template placementv1.PlacementAPISpec `json:"template,omitempty"`
// ExternalEndpoints, expose a VIP using a pre-created IPAddressPool
ExternalEndpoints []MetalLBConfig `json:"externalEndpoints,omitempty"`

// +kubebuilder:validation:Optional
// Override, provides the ability to override the generated manifest of several child resources.
Override PlacementOverrideSpec `json:"override,omitempty"`
}

// PlacementOverrideSpec to override the generated manifest of several child resources.
type PlacementOverrideSpec struct {
// +kubebuilder:validation:Optional
Route *route.OverrideSpec `json:"route,omitempty"`
}

// GlanceSection defines the desired state of Glance service
Expand Down
28 changes: 28 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.

Loading

0 comments on commit ab42cce

Please sign in to comment.