Skip to content
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

Add a node parameter to the FIO benchmark #105

Merged
merged 1 commit into from
Aug 16, 2022

Conversation

mmotejlek
Copy link
Contributor

I've added a parameter to the FIO benchmark which allows to specify a node on which to deploy the pod which runs the benchmark. Internally it sets the Node field in the Pod definition. The notation is --node or -N and the default value is empty, meaning no node is specified.

Examples of when setting a specific node matters:

  • Unequal connectivity bandwidth to nodes in the cluster.
  • Benchmarking on nodes which do not contain privisioned storage.
  • Keeping the same conditions when repeating benchmarks or trying different FIO configurations.

@ihcsim
Copy link
Contributor

ihcsim commented Jun 28, 2022

Thanks for the PR - this looks useful 👍. Any reasons why you pick nodeName over nodeSelector? Selector seems to offer more flexibility, and also more consistent with most K8s CLI tooling.

@mmotejlek
Copy link
Contributor Author

Thanks for the PR - this looks useful 👍. Any reasons why you pick nodeName over nodeSelector? Selector seems to offer more flexibility, and also more consistent with most K8s CLI tooling.

Good call, I originally wanted it in order to be able to repeat benchmarks on the same node and select any node without having to set up labels, but I found out that the "kubernetes.io/hostname" label would allow to do the same using hostnames. I'll change it to nodeSelector and notify this PR.

I've had a look at the current flags and conventions and it seems that it will be --nodeselector and either -N or -S, is that ok?

@ihcsim
Copy link
Contributor

ihcsim commented Jun 29, 2022

How about just follow the kubectl style?

$ kubectl get -h | grep -w "\-l"
  -l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)

I think just supporting = is fine.

@ihcsim
Copy link
Contributor

ihcsim commented Jul 15, 2022

Re-reading our earlier conversations, I think --node-selector="key=value" makes sense. I don't know if we really need a short-hand. If we do, -N is fine. Thanks for working on this.

@mmotejlek
Copy link
Contributor Author

mmotejlek commented Jul 18, 2022

I've pushed an implementation of a flag which sets the nodeSelector field in a Pod object. The existence of a node that satisfies the selector is validated before anything is created in Kubernetes.

--nodeselector -N

The name "nodeselector" was chosen without a dash for most consistency with existing flag names.

Usage: --nodeselector key1=value[,key2=value] [-N key3=value]

The used syntax is a subset of kubectl's --selector flag's syntax EXCEPT that it allows to write -N key1=value -N key2=value, while --selector only allows the -l key1=value,key2=value form. It should not be a problem in case of a future extension, it would just need to be taken into account; alternatively the current syntax would have to be restricted.

I'm not sure to which extend kubestr cares about backwards compatibility though; I've realized that the current versions are 0.x.

Tolerations need to be solved in order to be able to create pods anywhere but I'll create a separate issue discussing that.

Edit: Tolerations issue is #111

@ihcsim
Copy link
Contributor

ihcsim commented Aug 9, 2022

@mmotejlek thanks for the PR. Sorry for the late response - I just got back from vacation. I will review this shortly.

@ihcsim
Copy link
Contributor

ihcsim commented Aug 11, 2022

@mmotejlek Code change LGTM and works great. Also, appreciate the tests! Can you resolve the conflicts?

@mmotejlek
Copy link
Contributor Author

@ihcsim Conflicts resolved. Thanks for all the feedback on this.

Copy link
Contributor

@ihcsim ihcsim left a comment

Choose a reason for hiding this comment

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

LGTM 👍. Thanks!

@ihcsim
Copy link
Contributor

ihcsim commented Aug 16, 2022

@pavannd1 @bathina2 PTAL and merge, when ready. Thanks.

@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"os"
"k8s.io/apimachinery/pkg/labels"
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] this should probably move to the list below with other third-party imports

Not blocking the PR, we can fix it as a follow-up

@pavannd1 pavannd1 merged commit f3243a2 into kastenhq:master Aug 16, 2022
@pavannd1
Copy link
Contributor

Thanks for the PR @mmotejlek 🙏🏼

@mmotejlek mmotejlek mentioned this pull request Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants