-
Notifications
You must be signed in to change notification settings - Fork 34
Add SchedulerHints to server controller #632
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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"` | ||
|
|
||
| // availabilityZone is the availability zone in which to create the server. | ||
| // +kubebuilder:validation:MaxLength=255 | ||
| // +optional | ||
|
|
@@ -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. | ||
|
|
@@ -211,8 +210,57 @@ type ServerMetadata struct { | |
| Value string `json:"value,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:validation:MinProperties:=1 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason why you dropped these validations for the |
||
| // +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"` | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
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 | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
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
ServerSchedulerHintsstruct, 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 inServerSchedulerHintsis unset.Perhaps it's also a good time to introduce more backward incompatible changes in preparation for the next major release 🤷
There was a problem hiding this comment.
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.