Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create several services routes based on annotations on the svc endpoint #457

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,513 changes: 2,096 additions & 417 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml

Large diffs are not rendered by default.

42 changes: 41 additions & 1 deletion apis/core/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,57 @@ const (
// OpenStackControlPlaneKeystoneAPIReadyCondition Status=True condition which indicates if KeystoneAPI is configured and operational
OpenStackControlPlaneKeystoneAPIReadyCondition condition.Type = "OpenStackControlPlaneKeystoneAPIReady"

// OpenStackControlPlaneExposeKeystoneAPIReadyCondition Status=True condition which indicates if KeystoneAPI is exposed via a route
OpenStackControlPlaneExposeKeystoneAPIReadyCondition condition.Type = "OpenStackControlPlaneExposeKeystoneAPIReady"

// OpenStackControlPlanePlacementAPIReadyCondition Status=True condition which indicates if PlacementAPI is configured and operational
OpenStackControlPlanePlacementAPIReadyCondition condition.Type = "OpenStackControlPlanePlacementAPIReady"

// OpenStackControlPlaneExposePlacementAPIReadyCondition Status=True condition which indicates if PlacementAPI is exposed via a route
OpenStackControlPlaneExposePlacementAPIReadyCondition condition.Type = "OpenStackControlPlaneExposePlacementAPIReady"

// OpenStackControlPlaneGlanceReadyCondition Status=True condition which indicates if Glance is configured and operational
OpenStackControlPlaneGlanceReadyCondition condition.Type = "OpenStackControlPlaneGlanceReady"

// OpenStackControlPlaneExposeGlanceReadyCondition Status=True condition which indicates if Glance is exposed via a route
OpenStackControlPlaneExposeGlanceReadyCondition condition.Type = "OpenStackControlPlaneExposeGlanceReady"

// OpenStackControlPlaneCinderReadyCondition Status=True condition which indicates if Cinder is configured and operational
OpenStackControlPlaneCinderReadyCondition condition.Type = "OpenStackControlPlaneCinderReady"

// OpenStackControlPlaneExposeCinderReadyCondition Status=True condition which indicates if Cinder is exposed via a route
OpenStackControlPlaneExposeCinderReadyCondition condition.Type = "OpenStackControlPlaneExposeCinderReady"

// OpenStackControlPlaneOVNReadyCondition Status=True condition which indicates if OVN is configured and operational
OpenStackControlPlaneOVNReadyCondition condition.Type = "OpenStackControlPlaneOVNReady"

// OpenStackControlPlaneNeutronReadyCondition Status=True condition which indicates if Neutron is configured and operational
OpenStackControlPlaneNeutronReadyCondition condition.Type = "OpenStackControlPlaneNeutronReady"

// OpenStackControlPlaneExposeNeutronReadyCondition Status=True condition which indicates if Neutron is exposed via a route
OpenStackControlPlaneExposeNeutronReadyCondition condition.Type = "OpenStackControlPlaneExposeNeutronReady"

// OpenStackControlPlaneNovaReadyCondition Status=True condition which indicates if Nova is configured and operational
OpenStackControlPlaneNovaReadyCondition condition.Type = "OpenStackControlPlaneNovaReady"

// OpenStackControlPlaneExposeNovaReadyCondition Status=True condition which indicates if Nova is exposed via a route
OpenStackControlPlaneExposeNovaReadyCondition condition.Type = "OpenStackControlPlaneExposeNovaReady"

// OpenStackControlPlaneHeatReadyCondition Status=True condition which indicates if Heat is configured and operational
OpenStackControlPlaneHeatReadyCondition condition.Type = "OpenStackControlPlaneHeatReady"

// OpenStackControlPlaneExposeHeatReadyCondition Status=True condition which indicates if Heat is exposed via a route
OpenStackControlPlaneExposeHeatReadyCondition condition.Type = "OpenStackControlPlaneExposeHeatReady"

// OpenStackControlPlaneIronicReadyCondition Status=True condition which indicates if Ironic is configured and operational
OpenStackControlPlaneIronicReadyCondition condition.Type = "OpenStackControlPlaneIronicReady"

// OpenStackControlPlaneHorizonReadyCondition Status=True condition which indicates if Horizon is configured and operational
OpenStackControlPlaneHorizonReadyCondition condition.Type = "OpenStackControlPlaneHorizonReady"

// OpenStackControlPlaneExposeHorizonReadyCondition Status=True condition which indicates if Horizon is exposed via a route
OpenStackControlPlaneExposeHorizonReadyCondition condition.Type = "OpenStackControlPlaneExposeHorizonReady"

// OpenStackControlPlaneClientReadyCondition Status=True condition which indicates if OpenStackClient is configured and operational
OpenStackControlPlaneClientReadyCondition condition.Type = "OpenStackControlPlaneClientReady"

Expand All @@ -69,12 +93,18 @@ 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"

// OpenStackControlPlaneCeilometerReadyCondition Status=True condition which indicates if OpenStack Ceilometer service is configured and operational
OpenStackControlPlaneCeilometerReadyCondition condition.Type = "OpenStackControlPlaneCeilometerReady"

// OpenStackControlPlaneServiceOverrideReadyCondition Status=True condition which indicates if OpenStack service override has created ok
OpenStackControlPlaneServiceOverrideReadyCondition condition.Type = "OpenStackControlPlaneServiceOverrideReady"

// OpenStackControlPlaneManilaReadyInitMessage
OpenStackControlPlaneManilaReadyInitMessage = "OpenStackControlPlane Manila not started"

Expand All @@ -90,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 All @@ -107,7 +140,6 @@ const (

// OpenStackControlPlaneRedisReadyCondition Status=True condition which indicates if Redis is configured and operational
OpenStackControlPlaneRedisReadyCondition condition.Type = "OpenStackControlPlaneRedisReady"

)

// OpenStackControlPlane Reasons used by API objects.
Expand Down Expand Up @@ -338,4 +370,12 @@ const (
// OpenStackControlPlaneRedisReadyErrorMessage
OpenStackControlPlaneRedisReadyErrorMessage = "OpenStackControlPlane Redis error occured %s"

// OpenStackControlPlaneExposeServiceReadyInitMessage
OpenStackControlPlaneExposeServiceReadyInitMessage = "OpenStackControlPlane %s exposing service %s not started"

// OpenStackControlPlaneExposeServiceReadyErrorMessage
OpenStackControlPlaneExposeServiceReadyErrorMessage = "OpenStackControlPlane %s exposing service via route %s error occured %s"

// OpenStackControlPlaneExposeServiceReadyMessage
OpenStackControlPlaneExposeServiceReadyMessage = "OpenStackControlPlane %s service exposed"
)
118 changes: 80 additions & 38 deletions apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@ import (
horizonv1 "github.com/openstack-k8s-operators/horizon-operator/api/v1beta1"
memcachedv1 "github.com/openstack-k8s-operators/infra-operator/apis/memcached/v1beta1"
networkv1 "github.com/openstack-k8s-operators/infra-operator/apis/network/v1beta1"
redisv1 "github.com/openstack-k8s-operators/infra-operator/apis/redis/v1beta1"
ironicv1 "github.com/openstack-k8s-operators/ironic-operator/api/v1beta1"
keystonev1 "github.com/openstack-k8s-operators/keystone-operator/api/v1beta1"
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
"github.com/openstack-k8s-operators/lib-common/modules/common/route"
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
"github.com/openstack-k8s-operators/lib-common/modules/storage"
manilav1 "github.com/openstack-k8s-operators/manila-operator/api/v1beta1"
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"
redisv1 "github.com/openstack-k8s-operators/infra-operator/apis/redis/v1beta1"
octaviav1 "github.com/openstack-k8s-operators/octavia-operator/api/v1beta1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -190,9 +191,21 @@ type KeystoneSection struct {
Enabled bool `json:"enabled"`

// +kubebuilder:validation:Optional
//+operator-sdk:csv:customresourcedefinitions:type=spec
// +operator-sdk:csv:customresourcedefinitions:type=spec
// Template - Overrides to use when creating the Keystone service
Template keystonev1.KeystoneAPISpec `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"`
}

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

// PlacementSection defines the desired state of Placement service
Expand All @@ -207,6 +220,11 @@ type PlacementSection struct {
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Template - Overrides to use when creating the Placement API
Template placementv1.PlacementAPISpec `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"`
}

// GlanceSection defines the desired state of Glance service
Expand All @@ -221,6 +239,11 @@ type GlanceSection struct {
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Template - Overrides to use when creating the Glance Service
Template glancev1.GlanceSpec `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"`
}

// CinderSection defines the desired state of Cinder service
Expand All @@ -235,6 +258,11 @@ type CinderSection struct {
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Template - Overrides to use when creating Cinder Resources
Template cinderv1.CinderSpec `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"`
}

// MariadbSection defines the desired state of MariaDB service
Expand Down Expand Up @@ -299,39 +327,6 @@ type RabbitmqTemplate struct {
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Overrides to use when creating the Rabbitmq clusters
rabbitmqv1.RabbitmqClusterSpec `json:",inline"`

// +kubebuilder:validation:Optional
//+operator-sdk:csv:customresourcedefinitions:type=spec
// ExternalEndpoint, expose a VIP via MetalLB on the pre-created address pool
ExternalEndpoint *MetalLBConfig `json:"externalEndpoint,omitempty"`
}

// MetalLBConfig to configure the MetalLB loadbalancer service
type MetalLBConfig struct {
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
//+operator-sdk:csv:customresourcedefinitions:type=spec
// IPAddressPool expose VIP via MetalLB on the IPAddressPool
IPAddressPool string `json:"ipAddressPool"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=true
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
// SharedIP if true, VIP/VIPs get shared with multiple services
SharedIP bool `json:"sharedIP"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=""
//+operator-sdk:csv:customresourcedefinitions:type=spec
// SharedIPKey specifies the sharing key which gets set as the annotation on the LoadBalancer service.
// Services which share the same VIP must have the same SharedIPKey. Defaults to the IPAddressPool if
// SharedIP is true, but no SharedIPKey specified.
SharedIPKey string `json:"sharedIPKey"`

// +kubebuilder:validation:Optional
//+operator-sdk:csv:customresourcedefinitions:type=spec
// LoadBalancerIPs, request given IPs from the pool if available. Using a list to allow dual stack (IPv4/IPv6) support
LoadBalancerIPs []string `json:"loadBalancerIPs"`
}

// OvnSection defines the desired state of OVN services
Expand Down Expand Up @@ -376,8 +371,13 @@ type NeutronSection struct {

// +kubebuilder:validation:Optional
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Template - Overrides to use when creating the Neutron service
// Template - Overrides to use when creating the Neutron Service
Template neutronv1.NeutronAPISpec `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"`
}

// NovaSection defines the desired state of Nova services
Expand All @@ -392,6 +392,24 @@ type NovaSection struct {
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Template - Overrides to use when creating the Nova services
Template novav1.NovaSpec `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"`

// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec
// CellOverride, provides the ability to override the generated manifest of several child resources
// for a nova cell. cell0 never have compute nodes and therefore it won't have a noVNCProxy deployed.
// Providing an override for cell0 noVNCProxy does not have an effect.
CellOverride map[string]NovaCellOverrideSpec `json:"cellOverride,omitempty"`
stuggi marked this conversation as resolved.
Show resolved Hide resolved
}

// NovaCellOverrideSpec to override the generated manifest of several child resources.
type NovaCellOverrideSpec struct {
// +kubebuilder:validation:Optional
NoVNCProxy Override `json:"noVNCProxy,omitempty"`
}

// HeatSection defines the desired state of Heat services
Expand All @@ -406,6 +424,16 @@ type HeatSection struct {
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Template - Overrides to use when creating the Heat services
Template heatv1.HeatSpec `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"`

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

// IronicSection defines the desired state of Ironic services
Expand Down Expand Up @@ -433,6 +461,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 All @@ -445,6 +478,11 @@ 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 Override `json:"apiOverride,omitempty"`
}

// CeilometerSection defines the desired state of OpenStack Telemetry services
Expand Down Expand Up @@ -473,6 +511,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 Expand Up @@ -501,7 +544,6 @@ type RedisSection struct {
//+operator-sdk:csv:customresourcedefinitions:type=spec
// Templates - Overrides to use when creating the Redis Resources
Templates map[string]redisv1.RedisSpec `json:"templates,omitempty"`

}

// OpenStackControlPlaneStatus defines the observed state of OpenStackControlPlane
Expand Down
Loading
Loading