-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 exclued node flag for load image command #3688
base: main
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Monokaix The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @Monokaix! |
Hi @Monokaix. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: Monokaix <[email protected]>
if !ok { | ||
return fmt.Errorf("unknown node: %q", name) | ||
} | ||
candidateNodes = nodeutils.RemoveNode(name, candidateNodes) |
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.
the end result candidateNodes
is processed with too many loops.
instead try using maps or a smarter way to process the excluded nodes.
for example, only add a node to candiateNodes if it's not in the excluded nodes.
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 reply! Will update later.
if !ok { | ||
return fmt.Errorf("unknown node: %q", name) | ||
} | ||
selectedNodes = nodeutils.RemoveNode(name, selectedNodes) |
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.
same problem here.
you can already specify the ones you want to load the image, why to use the negative too? |
Yeah ... not a fan of adding exclusive / confusing flag pairs, you can currently specify the set of nodes to load to with an existing flag |
Because when there are many kind nodes and I just want not loading to a few nodes, without this flag I have to specify most nodes, if we can support exclude semantics, it would be very convenient: ) |
We generally ask that features like this be discussed as a design first, so these discussions are resolved up front. The problem with adding every convenient little feature is bloat and poor test coverage / support ability. https://kind.sigs.k8s.io/docs/contributing/getting-started/ How many nodes is "many nodes"? We generally don't expect kind clusters to have many, in nearly all cases they should have one. For some specific use cases they might have a few. |
I can truly understand that, there are three cases I have to create a kind cluster with not only one node.
As kind becomes more and more popular, users use kind to deploy more than one node should be considered as a normal case:) |
That is quite normal, and is used regularly for testing. Usually that is a small number of nodes though, and anything scaling beyond that starts to be something better done with other tools than kind. It sounds like you've been able to get an impressive amount of scale for something not intended to scale that far. It would be interested to see how you've gotten around some of the limitations like inotify, etc. But I think type of setup would still be a very rare thing, so adding a (potentially) confusing option that is the inverse of an existing option may not be worth the maintenance and confusion it would cause. It may be better to add a step to query the cluster for the nodes you care about, then use that as input for the |
You're running kind with 100s or 1000s of nodes to do benchmarks?? That's a first 😅 Depending on what you're doing, you might also want to consider alternatives, I'd love to hear more about this 😅 Most users cannot get anywhere near this scale to work because it consumes a lot of resources on the host machine to do this, on many dimensions. What sort of environment are you running this in? Do you actually need real nodes? Would kwok / kubemark /... make more sense?
Well, it's quite common, but in many many cases it's not actually a very good fit for the task (e.g. kubemark / kwok may make more sense), and a lot of the time we find users pre-maturely adopting multiple nodes for misguided reasons and being frustrated with the experience, so I usually check if a single node or something else would be a better fit for their needs. Case in point:
That's not actually an appropriate use of kind nodes, because adding kind nodes DOES NOT actually add hardware resources, it only over-reports them. You should either adjust the resource requests for the workloads or run kind on a larger underlying host. Multiple kind nodes is a solution to testing multi-node behaviors in distributed systems (e.g. kubernetes networking implementations, some of the core project), not a solution to needing more resources. |
Autually when I deploy a cluster with one control plane and four workers node to do e2e test about scheduler's behavior,I have to specify four nodes after |
exclude node $ kind get nodes | grep -v kind-control-plane
kind-worker
kind-worker2 convert to comma separated list to pass to kind command $ kind get nodes | grep -v kind-control-plane | paste -sd, -
kind-worker,kind-worker2 voila $ kind load docker-image busybox:stable --nodes $(kind get nodes | grep -v kind-control-plane | paste -sd, -)
Image with ID: sha256:65ad0d468eb1c558bf7f4e64e790f586e9eda649ee9f130cd0e835b292bbc5ac already present on the node kind-worker but is missing the tag docker.io/library/busybox:stable. re-tagging...
Image with ID: sha256:65ad0d468eb1c558bf7f4e64e790f586e9eda649ee9f130cd0e835b292bbc5ac already present on the node kind-worker2 but is missing the tag docker.io/library/busybox:stable. re-tagging... |
It sounds like your actually use case is to exclude by role? (Again, this is why we prefer to discuss features on a issue before implementation PRs per our contribution guide) In the meantime you can make that snippet portable across clusters and shorter by |
When using kind load command I want to exclude some nodes,for example,I want to load to all nodes except master node,because it has taint and is just a control plane and I don't want load image to this node,so add a new flag just exclude the specific node would be helpful.