-
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?
Conversation
winiciusallan
left a comment
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.
Looks good overall! Great job! Just a few comments. Let me know what you think.
internal/controllers/server/tests/server-create-full/00-create-resource.yaml
Show resolved
Hide resolved
7b0df63 to
bdf5e4f
Compare
| // will be created in the server group. | ||
| // +optional | ||
| // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serverGroupRef is immutable" | ||
| ServerGroupRef *KubernetesNameRef `json:"serverGroupRef,omitempty"` |
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 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 🤷
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.
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.
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.
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.
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.
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.
Let's see what other potentially breaking changes we need to introduce for the CAPO feature parity work before making a decision.
| // buildNearHostIP specifies a subnet of compute nodes to host the server. | ||
| // +kubebuilder:validation:MaxLength:=255 | ||
| // +optional | ||
| BuildNearHostIP string `json:"buildNearHostIP,omitempty"` |
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.
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?
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.
Actually in Gopher cloud you provide it as 10.10.10.10/24 in one string and gophercloud split it on its own here , so I think in this case we don't require a separate cider field. the user should just provide it as ip/cider I will expend on it in the doc string above to make it clearer.
As this is a host subnet I believe we shouldn't use subnet ref.
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.
Expended doc string let me know if thats ok now
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.
What do you think of:
buildNearHost:
ip: 10.10.10.10
prefixLength: 24This allows easier validation, and PrefixLength could be marked as optional (according to the docs, it defauls to 24 if not specified).
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.
by validation you are referring to the prefix length min-max 1-32? or something additional?
To me the cider format feels more intuitive so I personally prefer the cider format. It also saves us from some additional string manipulation as this is how Gophercloud expects to receive it. I would prefer keeping it as it is now.
f6e8392 to
8894f8f
Compare
4bc925c to
54a3ad6
Compare
ce7d860 to
d979876
Compare
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.
Thanks for your effort, @eshulman2!
To me, it is very close to a merge state, I just left a comment on the dependency that you added, let me know what you think.
- Add SchedulerHints to server controller - enable required nova filters for testing hints NOTE! this change MOVED the ServerGroupRef inside the ServerSchedulerHints
mandre
left a comment
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 believe this is almost ready. I would still like to keep this for a little longer in the queue to make up my mind about the breaking/non-breaking change.
| // buildNearHostIP specifies a subnet of compute nodes to host the server. | ||
| // +kubebuilder:validation:MaxLength:=255 | ||
| // +optional | ||
| BuildNearHostIP string `json:"buildNearHostIP,omitempty"` |
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.
What do you think of:
buildNearHost:
ip: 10.10.10.10
prefixLength: 24This allows easier validation, and PrefixLength could be marked as optional (according to the docs, it defauls to 24 if not specified).
| // will be created in the server group. | ||
| // +optional | ||
| // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serverGroupRef is immutable" | ||
| ServerGroupRef *KubernetesNameRef `json:"serverGroupRef,omitempty"` |
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.
Let's see what other potentially breaking changes we need to introduce for the CAPO feature parity work before making a decision.
Add schedulerHints field with support for:
NOTE! this change MOVED the ServerGroupRef inside the ServerSchedulerHints