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

Need a real "get-all" command #527

Open
schollii opened this issue Aug 29, 2018 · 12 comments

Comments

Projects
None yet
8 participants
@schollii
Copy link

commented Aug 29, 2018

FEATURE REQUEST:

Add a get-all command that really shows all objects, with some flags to filter on certain types (namespaced vs non-namespaced, etc).

Similarly, the dashboard should have a mode to show all resources (again, dashboard does not show networkpolicy objects, not even in pod descriptions to say "this pod is selected by this networkpolicy object". But dashboard improvement should be implemented separately, as the most important and urgent one is the kubectl new command.

Kubernetes version (use kubectl version):

1.11.2

What happened:

kubectl get all only shows a small subset of kubernetes objects in a cluster, and there does not seem to be a command to get all objects (secrets, network policies, etc). This caused me hours of wasted time because I was trying to replicate a deployment object from another cluster into a new cluster, and didn't see that there was a networkpolicy needed for the service to expose that deployment.

What you expected to happen:

That kubect get all would show all, not just a small number of types of resources.

How to reproduce it (as minimally and precisely as possible):

Create a networkpolicy then do kubectl get all, it doesn't show up. However, it does show up with kubectl get netpol and kubectl api-resources -o name | xargs -t -n 1 kubectl get --ignore-not-found --show-kind | grep SOMETHING_IN_NAME

@seans3

This comment has been minimized.

Copy link
Contributor

commented Sep 26, 2018

/kind feature
/sig cli
/area kubectl
/priority P3

@juanvallejo

This comment has been minimized.

Copy link
Member

commented Sep 26, 2018

This functionality sounds like something that'd be great to implement as a plugin

@schollii

This comment has been minimized.

Copy link
Author

commented Sep 27, 2018

Where would I start? I know some Go and I have lots of software dev experience so that part is not a problem, it's more the logistics : how do I mark that I'm working on this so people know, where do I publish it for peer review, for downloading, etc. I found https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/, are there other links that I should look at?

@juanvallejo

This comment has been minimized.

Copy link
Member

commented Sep 27, 2018

@schollii

Where would I start?

I am currently updating the docs for plugins, so that they are up to date with the current plugin system: kubernetes/website#10259, see https://deploy-preview-10259--kubernetes-io-master-staging.netlify.com/docs/tasks/extend-kubectl/kubectl-plugins/ (while that PR merges) for an accurate doc on the current state of plugins.

You can also take a look at https://github.com/kubernetes/sample-cli-plugin for a detailed example of writing a plugin in Go.

how do I mark that I'm working on this so people know, where do I publish it for peer review, for downloading, etc

Although there's no official registry or repo where you would formally declare your work on a plugin (for now), you are always welcome to host it on a repo of your own, and link to it in the slack channel for SIG-CLI, as well as request peer review there.

I'd be happy to help review it as well. Feel free to reach out on Slack with any questions.
Thanks

@juanvallejo

This comment has been minimized.

Copy link
Member

commented Sep 28, 2018

@schollii plugin documentation has now been updated. You can find a guide for writing plugins under the new mechanism at: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/#writing-kubectl-plugins

@seans3 seans3 added this to Low priority in kubectl prioritized bugs Oct 5, 2018

@seans3 seans3 moved this from Low priority (P2/P3) to Priority P3 in kubectl prioritized bugs Oct 5, 2018

@seans3 seans3 removed this from Priority P3 in kubectl prioritized bugs Nov 9, 2018

@fejta-bot

This comment has been minimized.

Copy link

commented Dec 27, 2018

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@fejta-bot

This comment has been minimized.

Copy link

commented Jan 26, 2019

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@schollii

This comment has been minimized.

Copy link
Author

commented Jan 26, 2019

/remove-lifecycle rotten

@corneliusweig

This comment has been minimized.

Copy link

commented Feb 19, 2019

@schollii Have a look at https://github.com/corneliusweig/ketall . It is also available via krew, so that it can be installed via kubectl krew install get-all. Please raise an issue, if this doesn't fully meet your requirements.

@rohantmp

This comment has been minimized.

Copy link

commented Mar 7, 2019

quick hack: kubectl get $(kubectl api-resources| awk '{ print $1 }'|grep -v "NAME"|xargs|sed -e 's/ /,/g')

@fejta-bot

This comment has been minimized.

Copy link

commented Jun 5, 2019

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@alexkreidler

This comment has been minimized.

Copy link

commented Jun 28, 2019

I firmly believe that this functionality belongs in the core. It is unrealistic to say that you are displaying all kubernetes resources and it is misleading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.