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

Umbrella issue for kubectl config command overhaul #20605

Open
bgrant0607 opened this issue Feb 3, 2016 · 14 comments
Open

Umbrella issue for kubectl config command overhaul #20605

bgrant0607 opened this issue Feb 3, 2016 · 14 comments

Comments

@bgrant0607
Copy link
Member

@bgrant0607 bgrant0607 commented Feb 3, 2016

kubectl config strongly departs from the command and output conventions of other commands. It shouldn't.

Current commands:
https://github.com/kubernetes/kubernetes/blob/master/docs/user-guide/kubectl/kubectl_config.md

Conventions:
https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md

Related: #5592, #7804, #8593, #8817, #9298, #10516, #10626, #10693, #10735, #11233, #16085, #16935, #20374

@deads2k proposed English descriptions:
#8593 (comment)
#20468 (comment)

@thockin proposed a family of commands:
#8593 (comment)
#10516 (comment)

TODO: Create proposal

cc @jlowdermilk @deads2k @thockin @quinton-hoole @kubernetes/kubectl

@bgrant0607
Copy link
Member Author

@bgrant0607 bgrant0607 commented Feb 15, 2016

Also, version, componentstatus, cluster-info, current-context, api-versions.

@bgrant0607
Copy link
Member Author

@bgrant0607 bgrant0607 commented Mar 12, 2016

@smparkes
Copy link

@smparkes smparkes commented Mar 20, 2016

FWIW, the relationship with glcoud is also a bit confusing when switching contexts.

My "best guess" gcloud config set container/cluster CLUSTER_NAME doesn't change the kubeconfig, i.e., "best guess" is not "good guess".

But gcloud container clusters get-credentials CLUSTER_NAME does, which was unexpected.

Took me a while (and grubbing through the sdk) to realize that it was get-credentials making the change, not the set.

get-credentials is kind of overkill but better than using kubectl directly since the kubeconfig context.name != CLUSTER_NAME.

@bgrant0607
Copy link
Member Author

@bgrant0607 bgrant0607 commented Mar 28, 2016

@bgrant0607
Copy link
Member Author

@bgrant0607 bgrant0607 commented Apr 20, 2016

Ref #23492

@bgrant0607
Copy link
Member Author

@bgrant0607 bgrant0607 commented May 10, 2016

It's also unfortunate that it takes 3 commands to set up kubectl for a new cluster. For example:

kubectl config set-cluster minikube --insecure-skip-tls-verify=true --server=http://192.168.99.100:8080
kubectl config set-context minikube --cluster=minikube
kubectl config use-context minikube

@bgrant0607
Copy link
Member Author

@bgrant0607 bgrant0607 commented May 11, 2016

There's some discussion in #25383, also

@janetkuo
Copy link
Member

@janetkuo janetkuo commented May 20, 2016

#25601 for deleting cluster from kubectl config

@duglin
Copy link
Contributor

@duglin duglin commented Aug 16, 2016

I'd like to suggest that we look at : http://kubernetes.io/docs/user-guide/docker-cli-to-kubectl/
and consider what it would take to make the kubectl version of these commands as easy and friendly to use as they are with Docker. That could really help define a pattern for how we revamp things.

Each extra parameter, each extra step needed, each extra bit of extra output (noise) should be scrutinized and questioned.

Yes, I'm holding up Docker as our minimum bar because I think they've done a great job so far. If kubectl can surpass them then that's great, but let's at least give our users an on-par experience.

@duglin
Copy link
Contributor

@duglin duglin commented Aug 16, 2016

oh oops, this is about just kubectl config, not just kubectl in general... I'll try to find a better home for the comment. :-)

@deads2k
Copy link
Contributor

@deads2k deads2k commented Aug 16, 2016

oh oops, this is about just kubectl config, not just kubectl in general... I'll try to find a better home for the comment. :-)

@duglin tag me in where you end up dropping this? I'd like some more detail on which commands you want to emulate. Some commands like docker ps I could see, but others like docker run (75-ish flags and counting) are less obvious to hold up as a examples.

@fejta-bot
Copy link

@fejta-bot fejta-bot commented Dec 26, 2017

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.

Prevent issues from auto-closing with an /lifecycle frozen comment.

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

@bgrant0607
Copy link
Member Author

@bgrant0607 bgrant0607 commented Jan 22, 2018

/remove-lifecycle stale
/lifecycle frozen

@rcoup
Copy link

@rcoup rcoup commented May 10, 2019

Adding a native way to get the current namespace that's simpler than kubectl config view -o jsonpath="{.contexts[?(.name==\"$(kubectl config current-context)\")].context.namespace}" would be a win too 😄

As another source of ideas, kubectx & kubens have been great tools for our team — managing a small set of contexts rather than hundreds of cluster/namespace combinations. Maybe they could even be folded into kubectl?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
9 participants