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
4 changes: 4 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
enable_workaround_docker_io: 'false'
branch: ${{ matrix.openstack_version }}
enabled_services: "openstack-cli-server"
conf_overrides: |
[[post-config|/etc/nova/nova.conf]]
[filter_scheduler]
enabled_filters = ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,SameHostFilter,DifferentHostFilter,SimpleCIDRAffinityFilter,JsonFilter

- name: Deploy a Kind Cluster
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab
Expand Down
64 changes: 57 additions & 7 deletions api/v1alpha1/server_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,6 @@ type ServerResourceSpec struct {
// +optional
Volumes []ServerVolumeSpec `json:"volumes,omitempty"`

// serverGroupRef is a reference to a ServerGroup object. The server
// will be created in the server group.
// +optional
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serverGroupRef is immutable"
ServerGroupRef *KubernetesNameRef `json:"serverGroupRef,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this should move in the ServerSchedulerHints struct, however, have you considered making this change backward compatible? This would require leaving the field at this level, that we mark as deprecated, and add some glue code to copy its value if the field in ServerSchedulerHints is unset.

Perhaps it's also a good time to introduce more backward incompatible changes in preparation for the next major release 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering that too. I think it makes sense. Also, we don't need to wait until the next major for get closer to CAPO parity.

We can create a issue so we don't lose the track.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I wasn't sure what is the best approach myself, I mainly wanted to avoid having to consolidate situations where the field was set in both making it confusing to use those fields. I believe that if we are on the verge of a new major we should keep it non-backward compatible and note that on the release and docs. In case the next major release is further away maybe we should have backward compatibility but I suspect this might be confusing to use and might result in unexpected results for costumers. I tend to lean towards keeping it non-backward compatible but I don't have a strong objections for making it BC either.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I can't provide enough feedback here, because I don't know the planned ORC release schedule, but since there are few changes for a new major release, I believe it will take a little longer.

I'll leave it up to both of you.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see what other potentially breaking changes we need to introduce for the CAPO feature parity work before making a decision.


// availabilityZone is the availability zone in which to create the server.
// +kubebuilder:validation:MaxLength=255
// +optional
Expand Down Expand Up @@ -194,6 +188,11 @@ type ServerResourceSpec struct {
// +optional
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="configDrive is immutable"
ConfigDrive *bool `json:"configDrive,omitempty"`

// schedulerHints provides hints to the Nova scheduler for server placement.
// +optional
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="schedulerHints is immutable"
SchedulerHints *ServerSchedulerHints `json:"schedulerHints,omitempty"`
}

// ServerMetadata represents a key-value pair for server metadata.
Expand All @@ -211,8 +210,59 @@ type ServerMetadata struct {
Value string `json:"value,omitempty"`
}

// +kubebuilder:validation:MinProperties:=1
// ServerSchedulerHints provides hints to the Nova scheduler for server placement.
type ServerSchedulerHints struct {
// serverGroupRef is a reference to a ServerGroup object. The server will be
// scheduled on a host in the specified server group.
// +optional
ServerGroupRef *KubernetesNameRef `json:"serverGroupRef,omitempty"`

// differentHostServerRefs is a list of references to Server objects.
// The server will be scheduled on a different host than all specified servers.
// +listType=set
// +kubebuilder:validation:MaxItems:=64
// +optional
DifferentHostServerRefs []KubernetesNameRef `json:"differentHostServerRefs,omitempty"`

// sameHostServerRefs is a list of references to Server objects.
// The server will be scheduled on the same host as all specified servers.
// +listType=set
// +kubebuilder:validation:MaxItems:=64
// +optional
SameHostServerRefs []KubernetesNameRef `json:"sameHostServerRefs,omitempty"`

// query is a conditional statement that results in compute nodes
// able to host the server.
// +kubebuilder:validation:MaxLength:=1024
// +optional
Query string `json:"query,omitempty"`

// targetCell is a cell name where the server will be placed.
// +kubebuilder:validation:MaxLength:=255
// +optional
TargetCell string `json:"targetCell,omitempty"`

// differentCell is a list of cell names where the server should not
// be placed.
// +listType=set
// +kubebuilder:validation:MaxItems:=64
// +kubebuilder:validation:items:MaxLength=1024
// +optional
DifferentCell []string `json:"differentCell,omitempty"`

// buildNearHostIP specifies a subnet of compute nodes to host the server.
// The host IP should be provided in an CIDR format like 10.10.10.10/24.
// +optional
BuildNearHostIP *CIDR `json:"buildNearHostIP,omitempty"`

// additionalProperties is a map of arbitrary key/value pairs that are
// not validated by Nova.
// +optional
AdditionalProperties map[string]string `json:"additionalProperties,omitempty"`
}

// +kubebuilder:validation:MaxProperties:=1
// +kubebuilder:validation:MinProperties:=1
type UserDataSpec struct {
// secretRef is a reference to a Secret containing the user data for this server.
// +optional
Expand Down
57 changes: 52 additions & 5 deletions api/v1alpha1/zz_generated.deepcopy.go

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

133 changes: 125 additions & 8 deletions cmd/models-schema/zz_generated.openapi.go

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

Loading
Loading