DEV Community

5 Tips to Be More Productive With Kubernetes

Peter Jausovec on August 08, 2019

Originally published at Learn Cloud Native Blog. I like to read about and see how people set up their environments and any tools, tips, and tricks...
Collapse
 
carehart_40 profile image
Charlie Arehart

Thanks for the tips, Peter. For fellow readers, note first that his original post (offered at the top here as a link to learnistio.com) is now at:

learncloudnative.com/blog/2019-08-...

And as for his first example showing:
kubectl get-contexts
while that will work with minikube, it may not work with other kub implementations, where instead one should use:
kubectl config get-contexts
(for that as well as the other args listed in his first point here). The Kub docs confirming this are here:

kubernetes.io/docs/reference/gener...

Collapse
 
peterj profile image
Peter Jausovec

Thanks Charlie! I've updated the post.

Collapse
 
carehart_40 profile image
Charlie Arehart

And thank you for the quick attention and response. :-)

Collapse
 
weibeld profile image
Daniel Weibel

For port-forwarding to a Pod, you don't necessarily need to get the Pod name. You can specify a Service or Deployment and kubectl will select one of the backing Pods automatically.

For example:

kubectl port-forward svc/grafana 3000:3000
Collapse
 
peterj profile image
Peter Jausovec

Good point! I think it’s time to update my scripts - I had that since before kubectl supported forwarding ports to services.

Collapse
 
dwdraju profile image
Raju Dawadi

kubefwd is another gig !

Collapse
 
mmr profile image
Marcio Ribeiro

Great tips.
You should check k9s: k9ss.io/

Collapse
 
alex_barashkov profile image
Alex Barashkov

Thanks for the tips. For port forwarding actually better to use kube-forwarder.pixelpoint.io/ It makes you more productive than generic CLI

Collapse
 
peterj profile image
Peter Jausovec

Thanks Alex! I’ll check out that tool.