-
Notifications
You must be signed in to change notification settings - Fork 125
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
Enhancement: Add cli switch to search all ALL un-namespaced objects (can be used in addition to the -n switch) #49
Comments
thanks for the proposal. out of curiosity: are there examples of this from other CLI tools for Kubernetes? I agree with the idea of this, but want to be consistent in terms of naming of this option for the sake of consistency. |
Hello @ahmetb! Seems like this flag I had a fresh KinD installation for testing purposes. It contains only a few deployments, please note the flag kubectl get deploy -A
NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
kube-system coredns 2/2 2 2 82m
local-path-storage local-path-provisioner 1/1 1 1 82m This plugin correctly shows tree-like structure when namespace is mentioned explicitly. kubectl tree deploy coredns -n kube-system
NAMESPACE NAME READY REASON AGE
kube-system Deployment/coredns - 84m
kube-system └─ReplicaSet/coredns-565d847f94 - 84m
kube-system ├─Pod/coredns-565d847f94-66mtj True 84m
kube-system └─Pod/coredns-565d847f94-bgqxs True 84m Unfortunately this doesn't happen with kubectl tree deploy coredns -A
Error: failed to get deploy/coredns: deployments.apps "coredns" not found Based on on the
|
@HectorB-2020 whats the output for
|
Well, this is interesting: 👍 kubectl get deploy coredns -A
error: a resource cannot be retrieved by name across all namespaces In fact this combination is never used with exact name. Usually generic results are filtered with parameters like kubectl tree deploy -A
Error: specify the kubernetes object in KIND NAME or KIND/NAME form Is there a scenario when |
This plugin currently takes a single object and constructs the object hierarchy from there. So if multiple objects with the same KIND/NAME are found while searching all namespaces, we either error out (and force user to qualify by namespace) or pick a namespace for the user (I like to avoid "magic"). Or we can change the tool to print the tree for multiple root objects across different namespaces. Which might be ok. In this case, we overloaded |
Thanks @ahmetb! It's clear now. 💯 |
I am not aware of equivalent functionality in something like |
I am working with a controller that manages a CRD which creates a namespace and then creates some additional resources in that namespace. With the current options, I am forced to search all namespaces to get the complete list of resources that this CRD resource owns.
It would be great to add a cli option like
-C/--cluster-resources
that could be used to specifically request that non-namespaced resources be checked. This should make it possible to find everything, without performing a overly broad search possible, using something like this:The text was updated successfully, but these errors were encountered: