Zero-to-jupyterhub-k8s: Working with kubectl / helm - Time saving tips?

Created on 1 Apr 2018  Â·  6Comments  Â·  Source: jupyterhub/zero-to-jupyterhub-k8s

Perhaps we could find a place to squeeze in quick and simple recommendations on working with tools like kubectl and helm that has saved us time?

For me, the biggest timesavers have been the following.

  • [ ] kubectl default namespace
# a default namespace for kubectl (in the 'current context') can be setup like this...
kubectl config set-context $(kubectl config current-context) --namespace=<insert-namespace-name-here>
  • [ ] [kubectl autocomplete](https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion)
  • [ ] [helm autocomplete](https://docs.helm.sh/helm/#helm-completion)
  • [ ] kubectl --selector or -l: get resources based on labels instead of dynamic names

All 6 comments

I think this kinda thing is a good idea, though maybe this is the kind of thing that'd be well-suited for a "community docs" section of some kind? We have something like this for the mybinder.org team here: http://mybinder-sre.readthedocs.io/en/latest/command_snippets.html and I've found it quite useful!

I think these are basic and generic enough we can put them in the guide
itself. We should link out to docs as much as possible though, rather than
write them in here.

On Sun, Apr 1, 2018 at 9:25 AM, Chris Holdgraf notifications@github.com
wrote:

I think this kinda thing is a good idea, though maybe this is the kind of
thing that'd be well-suited for a "community docs" section of some kind? We
have something like this for the mybinder.org team here:
http://mybinder-sre.readthedocs.io/en/latest/command_snippets.html and
I've found it quite useful!

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/jupyterhub/zero-to-jupyterhub-k8s/issues/623#issuecomment-377798238,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAB23vQx1M_Wm77_93Br73LtWiezqJAIks5tkP9egaJpZM4TC4ez
.

--
Yuvi Panda T
http://yuvi.in/blog

I like (and use a lot) https://github.com/ahmetb/kubectx. What has happened a few times to me though is that I helm upgrade'ed the wrong k8s context. Haven't found a good solution other than prefixing my Helm command lines with kctx explicit-context-here && helm .... Min has https://github.com/minrk/git-stuff/blob/master/kubernetes.bashrc which is also useful and per terminal instead of global.

I use https://github.com/jonmosco/kube-ps1 to keep myself sane! Might be
useful to others too :)

On Mon, Apr 2, 2018 at 12:17 AM, Tim Head notifications@github.com wrote:

I like (and use a lot) https://github.com/ahmetb/kubectx. What has
happened a few times to me though is that I helm upgrade'ed the wrong k8s
context. Haven't found a good solution other than prefixing my Helm command
lines with kctx explicit-context-here && helm .... Min has
https://github.com/minrk/git-stuff/blob/master/kubernetes.bashrc which is
also useful and per terminal instead of global.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/jupyterhub/zero-to-jupyterhub-k8s/issues/623#issuecomment-377872821,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAB23hnb0pdlhsRM0Y9J4LnrZwATZwQfks5tkdCSgaJpZM4TC4ez
.

--
Yuvi Panda T
http://yuvi.in/blog

@yuvipanda @betatim Thanks! I figured I missed out on some valuable experience :D

I also discovered https://github.com/cloudnativelabs/kube-shell today.
Looks very cool.

On Mon, Apr 2, 2018 at 4:54 AM, Erik Sundell notifications@github.com
wrote:

@yuvipanda https://github.com/yuvipanda @betatim
https://github.com/betatim Thanks! I figured I missed out on some
valuable experience :D

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jupyterhub/zero-to-jupyterhub-k8s/issues/623#issuecomment-377914651,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAB23pDXbl7MVkCgufPAD8segIQ8Nze4ks5tkhGIgaJpZM4TC4ez
.

--
Yuvi Panda T
http://yuvi.in/blog

Was this page helpful?
0 / 5 - 0 ratings