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: 56 additions & 8 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.


// 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,57 @@ type ServerMetadata struct {
Value string `json:"value,omitempty"`
}

// +kubebuilder:validation:MinProperties:=1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason why you dropped these validations for the UserDataSpec?

// +kubebuilder:validation:MaxProperties:=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.
// +kubebuilder:validation:MaxLength:=255
// +optional
BuildNearHostIP string `json:"buildNearHostIP,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

According to the docs, this must go together with os:scheduler_hints.cidr:

Schedule the server on a host in the network specified with this parameter and a cidr (os:scheduler_hints.cidr)

However we don't provide this option. Should we instead have a reference to a subnet?


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

type UserDataSpec struct {
// secretRef is a reference to a Secret containing the user data for this server.
// +optional
Expand Down
52 changes: 47 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