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

Kind wildcarding/discovery in kubectl #5278

Closed
bgrant0607 opened this issue Mar 11, 2015 · 8 comments
Closed

Kind wildcarding/discovery in kubectl #5278

bgrant0607 opened this issue Mar 11, 2015 · 8 comments
Labels
area/kubectl area/usability priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@bgrant0607
Copy link
Member

Forked from #3233.

I think the last proposal was to support:

kubectl describe all
kubectl describe all foo

where "all" implies all known kinds.

@brendandburns @smarterclayton

@bgrant0607 bgrant0607 added area/usability area/kubectl priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Mar 11, 2015
@smarterclayton
Copy link
Contributor

One wrinkle - should all include "namespaced" resources and "cluster resources", just "namespaced resources", or just "resources you actually have access to view" (because there will be some in that list that an end user probably won't have access to list)

----- Original Message -----

Forked from #3233.

I think the last proposal was to support:

kubectl describe all
kubectl describe all foo

where "all" implies all known kinds.

@brendandburns @smarterclayton


Reply to this email directly or view it on GitHub:
#5278

@derekwaynecarr
Copy link
Member

Is this a listing call or is it just short-hand for user typing:

kubectl describe pods foo
kubectl describe services foo
kubectl describe namespaces foo
...

In general, not all of resource types support describe yet if I recall, so that should probably be resolved first.

----- Original Message -----
From: "Clayton Coleman" notifications@github.com
To: "GoogleCloudPlatform/kubernetes" kubernetes@noreply.github.com
Sent: Wednesday, March 18, 2015 5:24:30 PM
Subject: Re: [kubernetes] Kind wildcarding/discovery in kubectl (#5278)

One wrinkle - should all include "namespaced" resources and "cluster resources", just "namespaced resources", or just "resources you actually have access to view" (because there will be some in that list that an end user probably won't have access to list)

----- Original Message -----

Forked from #3233.

I think the last proposal was to support:

kubectl describe all
kubectl describe all foo

where "all" implies all known kinds.

@brendandburns @smarterclayton


Reply to this email directly or view it on GitHub:
#5278


Reply to this email directly or view it on GitHub:
#5278 (comment)

@smarterclayton
Copy link
Contributor

Short hand. Eventually might be server calculated and cached locally in the config

On Mar 19, 2015, at 11:15 AM, Derek Carr notifications@github.com wrote:

Is this a listing call or is it just short-hand for user typing:

kubectl describe pods foo
kubectl describe services foo
kubectl describe namespaces foo
...

In general, not all of resource types support describe yet if I recall, so that should probably be resolved first.

----- Original Message -----
From: "Clayton Coleman" notifications@github.com
To: "GoogleCloudPlatform/kubernetes" kubernetes@noreply.github.com
Sent: Wednesday, March 18, 2015 5:24:30 PM
Subject: Re: [kubernetes] Kind wildcarding/discovery in kubectl (#5278)

One wrinkle - should all include "namespaced" resources and "cluster resources", just "namespaced resources", or just "resources you actually have access to view" (because there will be some in that list that an end user probably won't have access to list)

----- Original Message -----

Forked from #3233.

I think the last proposal was to support:

kubectl describe all
kubectl describe all foo

where "all" implies all known kinds.

@brendandburns @smarterclayton


Reply to this email directly or view it on GitHub:
#5278


Reply to this email directly or view it on GitHub:
#5278 (comment)

Reply to this email directly or view it on GitHub.

@derekwaynecarr
Copy link
Member

If its short-hand it should just be "all cluster scoped resources with name foo and all namespace scoped resources in current namespace context name foo".

----- Original Message -----
From: "Clayton Coleman" notifications@github.com
To: "GoogleCloudPlatform/kubernetes" kubernetes@noreply.github.com
Cc: "Derek Carr" decarr@redhat.com
Sent: Thursday, March 19, 2015 11:53:39 AM
Subject: Re: [kubernetes] Kind wildcarding/discovery in kubectl (#5278)

Short hand. Eventually might be server calculated and cached locally in the config

On Mar 19, 2015, at 11:15 AM, Derek Carr notifications@github.com wrote:

Is this a listing call or is it just short-hand for user typing:

kubectl describe pods foo
kubectl describe services foo
kubectl describe namespaces foo
...

In general, not all of resource types support describe yet if I recall, so that should probably be resolved first.

----- Original Message -----
From: "Clayton Coleman" notifications@github.com
To: "GoogleCloudPlatform/kubernetes" kubernetes@noreply.github.com
Sent: Wednesday, March 18, 2015 5:24:30 PM
Subject: Re: [kubernetes] Kind wildcarding/discovery in kubectl (#5278)

One wrinkle - should all include "namespaced" resources and "cluster resources", just "namespaced resources", or just "resources you actually have access to view" (because there will be some in that list that an end user probably won't have access to list)

----- Original Message -----

Forked from #3233.

I think the last proposal was to support:

kubectl describe all
kubectl describe all foo

where "all" implies all known kinds.

@brendandburns @smarterclayton


Reply to this email directly or view it on GitHub:
#5278


Reply to this email directly or view it on GitHub:
#5278 (comment)

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub:
#5278 (comment)

@smarterclayton
Copy link
Contributor

I didn't really intend to support "all " - instead you'd have to say "pods/foo nodes/foo". That way create can do "pods/foo\nnodes/foo" and you can xargs it. If you specify a resource type for arg1 i don't think you should be allowed to specify anything except label selectors or --all.

----- Original Message -----

If its short-hand it should just be "all cluster scoped resources with name
foo and all namespace scoped resources in current namespace context name
foo".

----- Original Message -----
From: "Clayton Coleman" notifications@github.com
To: "GoogleCloudPlatform/kubernetes" kubernetes@noreply.github.com
Cc: "Derek Carr" decarr@redhat.com
Sent: Thursday, March 19, 2015 11:53:39 AM
Subject: Re: [kubernetes] Kind wildcarding/discovery in kubectl (#5278)

Short hand. Eventually might be server calculated and cached locally in the
config

On Mar 19, 2015, at 11:15 AM, Derek Carr notifications@github.com wrote:

Is this a listing call or is it just short-hand for user typing:

kubectl describe pods foo
kubectl describe services foo
kubectl describe namespaces foo
...

In general, not all of resource types support describe yet if I recall, so
that should probably be resolved first.

----- Original Message -----
From: "Clayton Coleman" notifications@github.com
To: "GoogleCloudPlatform/kubernetes" kubernetes@noreply.github.com
Sent: Wednesday, March 18, 2015 5:24:30 PM
Subject: Re: [kubernetes] Kind wildcarding/discovery in kubectl (#5278)

One wrinkle - should all include "namespaced" resources and "cluster
resources", just "namespaced resources", or just "resources you actually
have access to view" (because there will be some in that list that an end
user probably won't have access to list)

----- Original Message -----

Forked from #3233.

I think the last proposal was to support:

kubectl describe all
kubectl describe all foo

where "all" implies all known kinds.

@brendandburns @smarterclayton


Reply to this email directly or view it on GitHub:
#5278


Reply to this email directly or view it on GitHub:
#5278 (comment)

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub:
#5278 (comment)


Reply to this email directly or view it on GitHub:
#5278 (comment)

@eparis
Copy link
Contributor

eparis commented Mar 20, 2015

kubectl describe seems to know how to handle:
replicationcontroller, service, minion, node, limitrange, resourcequota, pod

kubectl get seems to know how to print something about:
pod, service, event, namespace, node, status, limitrange, resourcequota, replicationcontroller, endpoints, secret

So yeah, kubectl describe isn't nearly as knowledgeable as get

@bgrant0607
Copy link
Member Author

Delete across all resource kinds was requested by @Kargakis in #6511.

@smarterclayton
Copy link
Contributor

We should decide on the shorthand. The use case discussed in #6511 is really "delete all of the end user facing things in my namespace that match this label". I don't think it applies to nodes, events, users, tokens, security policies, or other root scoped objects (in this context). It's probably more like "stop all of these things", rather than delete. It has to be extensible when other resource types are added (it can be hardcoded, but the implementation has to be something provided via cmd.Factory).

My gut reaction was to define a ResourcesForAlias(resource string) ([]string, bool) on RESTMapper, which would be invoked by resource.Builder to expand the user input. It probably wouldn't be used in other contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl area/usability priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

4 participants