Skip to content

Commit fe5e105

Browse files
committed
Add SchedulerHints to server controller
Add SchedulerHints to server controller NOTE! this change MOVED the ServerGroupRef inside the ServerSchedulerHints
1 parent efc6482 commit fe5e105

20 files changed

+608
-74
lines changed

api/v1alpha1/server_types.go

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,6 @@ type ServerResourceSpec struct {
158158
// +optional
159159
Volumes []ServerVolumeSpec `json:"volumes,omitempty"`
160160

161-
// serverGroupRef is a reference to a ServerGroup object. The server
162-
// will be created in the server group.
163-
// +optional
164-
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serverGroupRef is immutable"
165-
ServerGroupRef *KubernetesNameRef `json:"serverGroupRef,omitempty"`
166-
167161
// availabilityZone is the availability zone in which to create the server.
168162
// +kubebuilder:validation:MaxLength=255
169163
// +optional
@@ -194,6 +188,62 @@ type ServerResourceSpec struct {
194188
// +optional
195189
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="configDrive is immutable"
196190
ConfigDrive *bool `json:"configDrive,omitempty"`
191+
192+
// schedulerHints provides hints to the Nova scheduler for server placement.
193+
// +optional
194+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="schedulerHints is immutable"
195+
SchedulerHints *ServerSchedulerHints `json:"schedulerHints,omitempty"`
196+
}
197+
198+
// ServerSchedulerHints provides hints to the Nova scheduler for server placement.
199+
type ServerSchedulerHints struct {
200+
// serverGroupRef is a reference to a ServerGroup object. The server will be
201+
// scheduled on a host in the specified server group.
202+
// +optional
203+
ServerGroupRef *KubernetesNameRef `json:"serverGroupRef,omitempty"`
204+
205+
// differentHostServerRefs is a list of references to Server objects.
206+
// The server will be scheduled on a different host than all specified servers.
207+
// +listType=set
208+
// +kubebuilder:validation:MaxItems:=64
209+
// +optional
210+
DifferentHostServerRefs []KubernetesNameRef `json:"differentHostServerRefs,omitempty"`
211+
212+
// sameHostServerRefs is a list of references to Server objects.
213+
// The server will be scheduled on the same host as all specified servers.
214+
// +listType=set
215+
// +kubebuilder:validation:MaxItems:=64
216+
// +optional
217+
SameHostServerRefs []KubernetesNameRef `json:"sameHostServerRefs,omitempty"`
218+
219+
// query is a conditional statement that results in compute nodes
220+
// able to host the server.
221+
// +kubebuilder:validation:MaxLength:=1024
222+
// +optional
223+
Query *string `json:"query,omitempty"`
224+
225+
// targetCell is a cell name where the server will be placed.
226+
// +kubebuilder:validation:MaxLength:=255
227+
// +optional
228+
TargetCell *string `json:"targetCell,omitempty"`
229+
230+
// differentCell is a list of cell names where the server should not
231+
// be placed.
232+
// +listType=set
233+
// +kubebuilder:validation:MaxItems:=64
234+
// +kubebuilder:validation:items:MaxLength=1024
235+
// +optional
236+
DifferentCell []string `json:"differentCell,omitempty"`
237+
238+
// buildNearHostIP specifies a subnet of compute nodes to host the server.
239+
// +kubebuilder:validation:MaxLength:=255
240+
// +optional
241+
BuildNearHostIP *string `json:"buildNearHostIP,omitempty"`
242+
243+
// additionalProperties is a map of arbitrary key/value pairs that are
244+
// not validated by Nova.
245+
// +optional
246+
AdditionalProperties map[string]string `json:"additionalProperties,omitempty"`
197247
}
198248

199249
// ServerMetadata represents a key-value pair for server metadata.

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 62 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/models-schema/zz_generated.openapi.go

Lines changed: 125 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)