Skip to content
Open
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
690 changes: 690 additions & 0 deletions api/bases/core.openstack.org_openstackcontrolplanes.yaml

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions api/bases/core.openstack.org_openstackversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ spec:
type: string
cloudkittyProcImage:
type: string
cyborgAPIImage:
type: string
cyborgAgentImage:
type: string
cyborgConductorImage:
type: string
designateAPIImage:
type: string
designateBackendbind9Image:
Expand Down Expand Up @@ -349,6 +355,12 @@ spec:
type: string
cloudkittyProcImage:
type: string
cyborgAPIImage:
type: string
cyborgAgentImage:
type: string
cyborgConductorImage:
type: string
designateAPIImage:
type: string
designateBackendbind9Image:
Expand Down Expand Up @@ -557,6 +569,12 @@ spec:
type: string
cloudkittyProcImage:
type: string
cyborgAPIImage:
type: string
cyborgAgentImage:
type: string
cyborgConductorImage:
type: string
designateAPIImage:
type: string
designateBackendbind9Image:
Expand Down Expand Up @@ -791,6 +809,12 @@ spec:
type: string
cloudkittyProcImage:
type: string
cyborgAPIImage:
type: string
cyborgAgentImage:
type: string
cyborgConductorImage:
type: string
designateAPIImage:
type: string
designateBackendbind9Image:
Expand Down
18 changes: 18 additions & 0 deletions api/core/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ const (

// OpenStackControlPlaneBackupConfigReadyCondition Status=True condition which indicates if OpenStackBackupConfig is reconciled
OpenStackControlPlaneBackupConfigReadyCondition condition.Type = "OpenStackControlPlaneBackupConfigReady"

// OpenStackControlPlaneCyborgReadyCondition Status=True condition which indicates if Cyborg is configured and operational
OpenStackControlPlaneCyborgReadyCondition condition.Type = "OpenStackControlPlaneCyborgReady"

// OpenStackControlPlaneExposeCyborgReadyCondition Status=True condition which indicates if Cyborg is exposed via a route
OpenStackControlPlaneExposeCyborgReadyCondition condition.Type = "OpenStackControlPlaneExposeCyborgReady"
)

// Common Messages used by API objects.
Expand Down Expand Up @@ -551,6 +557,18 @@ const (

// OpenStackControlPlaneInfrastructureReadyErrorMessage
OpenStackControlPlaneInfrastructureReadyErrorMessage = "OpenStackControlPlane Infrastructure error occured %s"

// OpenStackControlPlaneCyborgReadyInitMessage
OpenStackControlPlaneCyborgReadyInitMessage = "OpenStackControlPlane Cyborg not started"

// OpenStackControlPlaneCyborgReadyMessage
OpenStackControlPlaneCyborgReadyMessage = "OpenStackControlPlane Cyborg completed"

// OpenStackControlPlaneCyborgReadyRunningMessage
OpenStackControlPlaneCyborgReadyRunningMessage = "OpenStackControlPlane Cyborg in progress"

// OpenStackControlPlaneCyborgReadyErrorMessage
OpenStackControlPlaneCyborgReadyErrorMessage = "OpenStackControlPlane Cyborg error occured %s"
)

// Version Conditions used by to drive minor updates
Expand Down
35 changes: 35 additions & 0 deletions api/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

barbicanv1 "github.com/openstack-k8s-operators/barbican-operator/api/v1beta1"
cinderv1 "github.com/openstack-k8s-operators/cinder-operator/api/v1beta1"
cyborgv1 "github.com/openstack-k8s-operators/nova-operator/api/cyborg/v1beta1"
designatev1 "github.com/openstack-k8s-operators/designate-operator/api/v1beta1"
glancev1 "github.com/openstack-k8s-operators/glance-operator/api/v1beta1"
heatv1 "github.com/openstack-k8s-operators/heat-operator/api/v1beta1"
Expand Down Expand Up @@ -252,6 +253,11 @@ type OpenStackControlPlaneSpec struct {
// must be enabled for a service to use ApplicationCredentials.
// If omitted, defaults to enabled=false with standard expiration/grace periods.
ApplicationCredential ApplicationCredentialSection `json:"applicationCredential,omitempty"`

// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec
// Cyborg - Parameters related to the Cyborg service
Cyborg CyborgSection `json:"cyborg,omitempty"`
}

// TLSSection defines the desired state of TLS configuration
Expand Down Expand Up @@ -986,6 +992,32 @@ type WatcherSection struct {
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
}

// CyborgSection defines the desired state of Cyborg service
type CyborgSection struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
// Enabled - Whether Cyborg service should be deployed and managed
Enabled bool `json:"enabled"`

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

// ApplicationCredential allows service-specific overrides of the global AC configuration.
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +kubebuilder:validation:Optional
// +nullable
// +kubebuilder:default={enabled:false}
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
}

// +kubebuilder:validation:XValidation:rule="self.gracePeriodDays < self.expirationDays",message="gracePeriodDays must be smaller than expirationDays"
// ApplicationCredentialSection defines the desired configuration for ApplicationCredentials
type ApplicationCredentialSection struct {
Expand Down Expand Up @@ -1243,6 +1275,9 @@ func (instance *OpenStackControlPlane) InitConditions() {
if instance.Spec.Watcher.Enabled {
cl.Set(condition.UnknownCondition(OpenStackControlPlaneWatcherReadyCondition, condition.InitReason, OpenStackControlPlaneWatcherReadyInitMessage))
}
if instance.Spec.Cyborg.Enabled {
cl.Set(condition.UnknownCondition(OpenStackControlPlaneCyborgReadyCondition, condition.InitReason, OpenStackControlPlaneCyborgReadyInitMessage))
}

// Init Topology condition if there's a reference
if instance.Spec.TopologyRef != nil {
Expand Down
47 changes: 47 additions & 0 deletions api/core/v1beta1/openstackcontrolplane_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import (
ironicv1 "github.com/openstack-k8s-operators/ironic-operator/api/v1beta1"
manilav1 "github.com/openstack-k8s-operators/manila-operator/api/v1beta1"
neutronv1 "github.com/openstack-k8s-operators/neutron-operator/api/v1beta1"
cyborgv1 "github.com/openstack-k8s-operators/nova-operator/api/cyborg/v1beta1"
novav1 "github.com/openstack-k8s-operators/nova-operator/api/nova/v1beta1"
octaviav1 "github.com/openstack-k8s-operators/octavia-operator/api/v1beta1"
swiftv1 "github.com/openstack-k8s-operators/swift-operator/api/v1beta1"
Expand Down Expand Up @@ -360,6 +361,10 @@ func (r *OpenStackControlPlane) checkDepsEnabled(name string) string {
*r.Spec.Telemetry.Template.MetricStorage.Enabled) {
reqs = "Galera, Memcached, RabbitMQ, Keystone, Telemetry, Telemetry.Ceilometer, Telemetry.MetricStorage"
}
case "Cyborg":
if !(r.Spec.Galera.Enabled && r.Spec.Rabbitmq.Enabled && r.Spec.Keystone.Enabled && r.Spec.Placement.Enabled) {
reqs = "Galera, RabbitMQ, Keystone, Placement"
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
}

// If "reqs" is not the empty string, we have missing requirements
Expand Down Expand Up @@ -490,6 +495,13 @@ func (r *OpenStackControlPlane) ValidateCreateServices(basePath *field.Path) (ad
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Watcher.APIOverride.Route, basePath.Child("watcher").Child("apiOverride").Child("route"))...)
}

if r.Spec.Cyborg.Enabled {
warns, errs := r.Spec.Cyborg.Template.ValidateCreate(basePath.Child("cyborg").Child("template"), r.Namespace)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
errors = append(errors, errs...)
warnings = append(warnings, warns...)
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Cyborg.APIOverride.Route, basePath.Child("cyborg").Child("apiOverride").Child("route"))...)
}

if r.Spec.Telemetry.Enabled {
warns, errs := r.Spec.Telemetry.Template.ValidateCreate(basePath.Child("telemetry").Child("template"), r.Namespace)
errors = append(errors, errs...)
Expand Down Expand Up @@ -718,6 +730,17 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
warnings = append(warnings, warns...)
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Watcher.APIOverride.Route, basePath.Child("watcher").Child("apiOverride").Child("route"))...)
}

if r.Spec.Cyborg.Enabled {
if old.Cyborg.Template == nil {
old.Cyborg.Template = &cyborgv1.CyborgSpecCore{}
}
warns, errs := r.Spec.Cyborg.Template.ValidateUpdate(*old.Cyborg.Template, basePath.Child("cyborg").Child("template"), r.Namespace)
errors = append(errors, errs...)
warnings = append(warnings, warns...)
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Cyborg.APIOverride.Route, basePath.Child("cyborg").Child("apiOverride").Child("route"))...)
}

if r.Spec.Telemetry.Enabled {
if old.Telemetry.Template == nil {
old.Telemetry.Template = &telemetryv1.TelemetrySpecCore{}
Expand Down Expand Up @@ -883,6 +906,12 @@ func (r *OpenStackControlPlane) ValidateServiceDependencies(basePath *field.Path
allErrs = append(allErrs, err)
}
}
if r.Spec.Cyborg.Enabled {
if depErrorMsg := r.checkDepsEnabled("Cyborg"); depErrorMsg != "" {
err := field.Invalid(basePath.Child("cyborg").Child("enabled"), r.Spec.Cyborg.Enabled, depErrorMsg)
allErrs = append(allErrs, err)
}
}

return allErrs
}
Expand Down Expand Up @@ -1249,6 +1278,24 @@ func (r *OpenStackControlPlane) DefaultServices() {
}
}

// Cyborg
if r.Spec.Cyborg.Enabled || r.Spec.Cyborg.Template != nil {
if r.Spec.Cyborg.Template == nil {
r.Spec.Cyborg.Template = &cyborgv1.CyborgSpecCore{}
}
r.Spec.Cyborg.Template.Default()

if r.Spec.Cyborg.Enabled {
initializeOverrideSpec(&r.Spec.Cyborg.APIOverride.Route, true)
r.Spec.Cyborg.Template.SetDefaultRouteAnnotations(r.Spec.Cyborg.APIOverride.Route.Annotations)
}

// Default DatabaseInstance
if r.Spec.Cyborg.Template.DatabaseInstance == nil || *r.Spec.Cyborg.Template.DatabaseInstance == "" {
r.Spec.Cyborg.Template.DatabaseInstance = ptr.To("openstack")
}
}

}

// DefaultLabel - adding default label to the OpenStackControlPlane
Expand Down
3 changes: 3 additions & 0 deletions api/core/v1beta1/openstackversion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ type ContainerTemplate struct {
CinderSchedulerImage *string `json:"cinderSchedulerImage,omitempty"`
CloudKittyAPIImage *string `json:"cloudkittyAPIImage,omitempty"`
CloudKittyProcImage *string `json:"cloudkittyProcImage,omitempty"`
CyborgAPIImage *string `json:"cyborgAPIImage,omitempty"`
CyborgAgentImage *string `json:"cyborgAgentImage,omitempty"`
CyborgConductorImage *string `json:"cyborgConductorImage,omitempty"`
DesignateAPIImage *string `json:"designateAPIImage,omitempty"`
DesignateBackendbind9Image *string `json:"designateBackendbind9Image,omitempty"`
DesignateCentralImage *string `json:"designateCentralImage,omitempty"`
Expand Down
43 changes: 43 additions & 0 deletions api/core/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading