-
Notifications
You must be signed in to change notification settings - Fork 47
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
[FIO] Add CLI args for affinities and tolerations #109
[FIO] Add CLI args for affinities and tolerations #109
Conversation
This is my very first attempt at writting Go code so please feel free to suggest improvements. I'm off on vacation so also don't hesitate to update the code as you feel if you don't get any update from me. |
/cc @ihcsim @mmotejlek, here's another take at #105, please have a look |
The idea of using affinities + tolerations looks good to me. Unless there's a standard way that I'm unaware of, I'd extend syntax for tolerations by:
And for easier parsing it wouldn't be bad to allow colon at the end like this: EDIT: See comment below Personally I'd move the user input parsing and validation logic to the I can continue on the work. |
Update upon the syntax for tolerations suggested above:
This removes the standalone and trailing colon from the previous idea. |
From a UX perspective, I think like it's easier to work with node selector, than affinity and toleration (i.e. label k/v pairs vs. expresssion). It also allows us to achieve the original goal of scheduling the FIO pod on specific nodes with less code. |
(I deleted my previous comment because it turned out some things weren't the way I had thought) Regarding:
I was wrong about this, I didn't realize that it's possible to just hardcode a universal toleration for the pod (or maybe make it a switch). I think it'll be the best to implement nodeSelector as that's what was needed in the first place and leave room for a possible extension towards Kubectl's --selector syntax, which is a superset of a StringToString flag, unlike the syntax used in this PR (because of the way commas are treated). Sidenote: The --selector flag is parsed by this function: https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse. It should be possible to use it for an extension of the node selection feature by converting Parse's output into a corresponding NodeAffinity (note that --selector does not have all the capabilities of NodeAffinity). I'll go back to #105 and implement node selector as originally planned. |
@smasset-orange thanks again for this PR. For now, we will limit the scope to #105. If you are interested in working on more Go issues, feel free to check out the issues list. Also, we have another open source project named Kanister, which is a data protection workflow engine, with even more interesting issues. Cheers! |
Inspired from #105 but using node affinities (instead of setting Node attribute) and also handling different operators.