-
Notifications
You must be signed in to change notification settings - Fork 25
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
Query for multiple root elements by label #2
Comments
I'd potentially even be down to try and help implement this if seemingly useful! |
Hi @alexbarbato, really appreciate it! 🙂 Just want to clarify a bit more on your request. Given the following command, is this what you are looking for? kube-lineage --selector $LABEL_SELECTOR
Currently I'm a bit hesitant to implement this right away due to the following reasons 😥
Would it be possible to provide more information to help me understand your use-case better? Thank you! 🙏 |
By the way, would any of these potential features satisfy your use case? (currently in the backlog)
|
Thanks so much @tohjustin :D I totally understand your reservations and it makes sense to me what you're trying to accomplish. Technically what you're doing in To give you a bit more context, here's the workflow I'm following right now.
I end up having to query for both CRD's because they are all associated by a specific label versus owner refs across both objects to get a more holistic picture of the supply chain running and the resulting KNative service that is created. I definitely wouldn't recommend you build something exclusive for my use case, but hopefully the context gives you a bit better understanding of what I'm trying to accomplish. |
It is potentially worth mentioning that the Supply Chain above may have any other number of related CRD's that it doesn't "own", but were created as a part of the So right now it's only two KINDS I'm querying, but that could grow. |
Hi @alexbarbato, really appreciate for the detailed description of your use-case! 🙏 I'm glad to hear that scenario 2 would be able to handle your current use case. While waiting for the features demonstrated in scenario 1 & 2 to implemented, would the following bash function work for you? kubelineagebylabel() {
KINDS=workload.carto.run,serving.service.knative.dev
for RESOURCE in $(kubectl get $KINDS -l $1 -o name); do kubectl lineage $RESOURCE; done
} $ kubelineagebylabel app.tanzu.vmware.com/workload-type=web |
This also the first time I've heard of the Cartographer project, it looks really interesting after taking a quick look at its documentation. I have a few more questions regarding how it works if you don't mind:
Because if that's the case, would something like this make sense to you? $ kube-lineage clustersupplychain $SUPPLY_CHAIN_NAME kube-lineage could then implement custom logic to find all the |
Yup, effectively (the Tanzu Application Platform Beta ships with default supply chains so in my case I'm not actually writing these by hand, but I could)
So yes and no, I'd actually be looking for something like |
FWIW, I would find an implementation of Scenario 2 as described in #2 (comment) useful. |
Thanks so much for your great work here!!!
Use Case
It'd be so amazing if there were the ability to query by label for "multiple root elements". For example say we have multiple objects all correlated by label, but with their own lineage's below them. They are related and I'd like to view them all at the same time, with a single query.
Rough proposed API
kubectl lineage --selector app=my-awesome-app
as an exampleShorthand being
-l
Rough result
Query for elements that don't have owner-refs and define them as "roots" and apply the standard algorithm and render from there.
The text was updated successfully, but these errors were encountered: