Mauricio Salatino
@Salaboy / @ZeebeHQ / @Learnk8s
Boosting your
`kubectl` productivity
Where am I?
Remember this number
1.534.636.534.414.949.8
03.331.704.143.669
bash or zsh?
alias k = kubectl
~/.bashrc or ~/.zshrc
bash or zsh? Completion
> source <(kubectl completion bash)
> source <(kubectl completion zsh)
Switching Contexts/Namespaces
Stored in: ~/.kube/config
Switching
• kubectl config get-contexts: list all contexts
• kubectl config use-context: change the current context
Switching Efficiently
alias kcc='kubectl config use-context "$(klc | fzf -e | sed "s/^..//")"'
Doing it with style
Kubectx & Kubens
AutoGen Aliases
https://github.com/ahmetb/kubectl-aliases
A break for your TAB key
kgpooyaml -> (k get pods -oyaml)
Plugins
● Your own extensions to kubectl
● kubectl-kcon: V1 announcement and release party!
○ https://github.com/salaboy/kubectl-kcon
A Plugin to Rule them All
● Krew (https://github.com/kubernetes-sigs/krew)
○ Package Manager for kubectl plugins
■ Krew is a plugin itself!!
Summing up
● k
● k get p<TAB>
● kgpooyaml (no poo)
● Plugins / kubectl-kcon
● krew
Big kudos to Daniel Weibel !
https://learnk8s.io/blog/kubectl-productivity/
Summing up
● k
● k get p<TAB>
● kgpooyaml (no poo)
● Plugins / kubectl-kcon
● krew
Big kudos to Daniel Weibel !
https://learnk8s.io/blog/kubectl-productivity/

More Related Content

DOCX
Annette g09 job file for cyclohexene for niobium
DOCX
Annette g09 job file for cyclohexene
DOCX
Curcumin job file
PDF
Virtualize and automate your development environment for fun and profit
DOCX
Formaldehye2 job program
PDF
Using ansible to core os &amp; kubernetes clusters
PPTX
15 map reduce on azure
PDF
The power of streams in node js
Annette g09 job file for cyclohexene for niobium
Annette g09 job file for cyclohexene
Curcumin job file
Virtualize and automate your development environment for fun and profit
Formaldehye2 job program
Using ansible to core os &amp; kubernetes clusters
15 map reduce on azure
The power of streams in node js

What's hot (18)

PDF
Rubinius @ RubyAndRails2010
PDF
OpenNebulaConf 2016 - Icinga2 - APIFY them all by Achim Ledermüller, Netways ...
KEY
ncstudy#1 build_rails3_server
PDF
Simple Tips and Tricks with Ansible
PDF
Go-Couchbase Golang Paris 2015/12/17
KEY
Ruby on the server
KEY
CakePHP + PostgreSQL
PDF
[OpenInfra Days Korea 2018] Day 2 - E5-1: "Invited Talk: Kubicorn - Building ...
PDF
Scalability and Performance of CNS 3.6
PDF
Ruby 2.0 at the Ruby drink-up of Sophia, February 2013
PDF
Puppet Camp Dallas 2014: Using Puppet in Hybrid Cloud Deployments
PPTX
JavaScript code academy - introduction
PDF
Chasing the elephant
PPTX
AMIS OOW Review - Deel 6 - Emiel Paasschens
PPTX
Windows Azure Drive
PDF
Docker導入手順
PDF
PDF
My Learnings on Setting up a Kubernetes Cluster on AWS using Kubernetes Opera...
Rubinius @ RubyAndRails2010
OpenNebulaConf 2016 - Icinga2 - APIFY them all by Achim Ledermüller, Netways ...
ncstudy#1 build_rails3_server
Simple Tips and Tricks with Ansible
Go-Couchbase Golang Paris 2015/12/17
Ruby on the server
CakePHP + PostgreSQL
[OpenInfra Days Korea 2018] Day 2 - E5-1: "Invited Talk: Kubicorn - Building ...
Scalability and Performance of CNS 3.6
Ruby 2.0 at the Ruby drink-up of Sophia, February 2013
Puppet Camp Dallas 2014: Using Puppet in Hybrid Cloud Deployments
JavaScript code academy - introduction
Chasing the elephant
AMIS OOW Review - Deel 6 - Emiel Paasschens
Windows Azure Drive
Docker導入手順
My Learnings on Setting up a Kubernetes Cluster on AWS using Kubernetes Opera...
Ad

Similar to Boosting your kubectl productivity @ KubeCon 19 NA (20)

PPTX
TensorFlow London 14: Ben Hall 'Machine Learning Workloads with Kubernetes an...
PDF
$ kubectl hacking @DevOpsCon Berlin 2019
PDF
Multinode kubernetes-cluster
PPTX
GKE vs OpenStack Magnum
PPTX
From 0 to 60 with kubernetes and istio
PDF
kubernetes practice
PDF
Slides - Kubernetes on GKE.pdf
PDF
Enjoying k8s cluster with Minikube and Helm
PDF
Kubernetes Tutorial
PDF
Bdc from bare metal to k8s
PDF
Kubernetes meetup 102
PPTX
CKA_1st.pptx
PDF
Streams Don't Fail Me Now - Robustness Features in Kafka Streams
PDF
Kubernetes Basic Operation
PDF
Kubernetes: Wie Chefkoch.de mit Containern arbeitet
PDF
Running kubernetes
PPTX
Kubeflow on google kubernetes engine
PDF
Kubernetes installation
PDF
5 Kubernetes.pdf 5 Kubernetes.pdf 5 Kubernetes.pdf
PDF
[Hands-on] Kubernetes | Nov 18, 2017
TensorFlow London 14: Ben Hall 'Machine Learning Workloads with Kubernetes an...
$ kubectl hacking @DevOpsCon Berlin 2019
Multinode kubernetes-cluster
GKE vs OpenStack Magnum
From 0 to 60 with kubernetes and istio
kubernetes practice
Slides - Kubernetes on GKE.pdf
Enjoying k8s cluster with Minikube and Helm
Kubernetes Tutorial
Bdc from bare metal to k8s
Kubernetes meetup 102
CKA_1st.pptx
Streams Don't Fail Me Now - Robustness Features in Kafka Streams
Kubernetes Basic Operation
Kubernetes: Wie Chefkoch.de mit Containern arbeitet
Running kubernetes
Kubeflow on google kubernetes engine
Kubernetes installation
5 Kubernetes.pdf 5 Kubernetes.pdf 5 Kubernetes.pdf
[Hands-on] Kubernetes | Nov 18, 2017
Ad

More from Mauricio (Salaboy) Salatino (20)

PDF
Devoxx UK - Platforms on top of K8s
PDF
WTF_is_SRE_DeveloperEnabledPlatforms.pdf
PDF
Lessons Learnt from creating platforms on Kubernetes @ Rejekts
PDF
Building Developer Experiences for the Cloud .pdf
PDF
KUBEDAY - JAPAN 2022 - Building FaaS Platforms.pdf
PDF
The Challenges of building Cloud Native Platforms
PDF
Functions Working Group Update - August 2022.pdf
PDF
JBCNConf 2022: Go vs Java (Kubernetes)
PDF
Expanding Interoperability in the CD ecosystem - CDCon - Austin, TX - 2022
PDF
Spring I/O 2022: Knative and Spring - Bringing back the `func`
PDF
KnativeCon 2022 - Knative Functions
PDF
Knative Maintainers KubeConEU 22 Knative Overview and Update
PDF
CDEventsCon Expanding Interoperability in the CD ecosystem
PDF
A Polyglot Developer Experience on Kubernetes - KubeCon EU Valencia
PDF
Pave the Golden Path On Your Internal Platform
PDF
Knative and Spring - Bringing back the func.pdf
PDF
KCD Guatemala - Abstracciones sobre Abstracciones
PDF
KubeCon NA - 2021 Tools That I Wish Existed 3 Years Ago To Build a SaaS Offering
PDF
Cloud Native Islamabad - Getting Closer to Continuous Delivery with Knative
PDF
Intro to the Cloud with Knative (Spanish)
Devoxx UK - Platforms on top of K8s
WTF_is_SRE_DeveloperEnabledPlatforms.pdf
Lessons Learnt from creating platforms on Kubernetes @ Rejekts
Building Developer Experiences for the Cloud .pdf
KUBEDAY - JAPAN 2022 - Building FaaS Platforms.pdf
The Challenges of building Cloud Native Platforms
Functions Working Group Update - August 2022.pdf
JBCNConf 2022: Go vs Java (Kubernetes)
Expanding Interoperability in the CD ecosystem - CDCon - Austin, TX - 2022
Spring I/O 2022: Knative and Spring - Bringing back the `func`
KnativeCon 2022 - Knative Functions
Knative Maintainers KubeConEU 22 Knative Overview and Update
CDEventsCon Expanding Interoperability in the CD ecosystem
A Polyglot Developer Experience on Kubernetes - KubeCon EU Valencia
Pave the Golden Path On Your Internal Platform
Knative and Spring - Bringing back the func.pdf
KCD Guatemala - Abstracciones sobre Abstracciones
KubeCon NA - 2021 Tools That I Wish Existed 3 Years Ago To Build a SaaS Offering
Cloud Native Islamabad - Getting Closer to Continuous Delivery with Knative
Intro to the Cloud with Knative (Spanish)

Recently uploaded (20)

PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
STKI Israel Market Study 2025 version august
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
UiPath Agentic Automation session 1: RPA to Agents
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPT
What is a Computer? Input Devices /output devices
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PPT
Geologic Time for studying geology for geologist
PPTX
Microsoft Excel 365/2024 Beginner's training
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
PPTX
The various Industrial Revolutions .pptx
A review of recent deep learning applications in wood surface defect identifi...
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Chapter 5: Probability Theory and Statistics
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
STKI Israel Market Study 2025 version august
Module 1.ppt Iot fundamentals and Architecture
Zenith AI: Advanced Artificial Intelligence
UiPath Agentic Automation session 1: RPA to Agents
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
OpenACC and Open Hackathons Monthly Highlights July 2025
A comparative study of natural language inference in Swahili using monolingua...
NewMind AI Weekly Chronicles – August ’25 Week III
What is a Computer? Input Devices /output devices
1 - Historical Antecedents, Social Consideration.pdf
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Geologic Time for studying geology for geologist
Microsoft Excel 365/2024 Beginner's training
Developing a website for English-speaking practice to English as a foreign la...
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
The various Industrial Revolutions .pptx

Boosting your kubectl productivity @ KubeCon 19 NA

Editor's Notes

  • #2: My name is mauricio salatino @salaboy in twitter and github and I do work for a company called camunda, we do microservices orchestration with ZeebeHQ and I also collaborate with @learnk8s as a kubernertes instructor. LearnK8s provides kubernetes trainings. Big shout to Daniel who wrote a blog post about this subject which would take more than 5 mins to go over it.
  • #3: A little bit of context first, when we talk about kubectl, we need to position ourselves on the client side. You will be interacting against an HTTP server which is exposing Restful endpoints which will expect different payloads to execute different commands. Kubectl will craft these HTTP commands based on the parameters that you type and then send it to the currently configured kubernetes master.
  • #4: Before we start with the tips, I want to share this number with you.. It is a really really important number for me, it represents the number of hours that we can all save if we follow the tips presented in this session. If you take away something from this session is this number, so don’t forget it. This number is based on long hours of research and calculations and to understand more about how these number was calculated let’s start with the tips. If you want to save time and money to your employers then we can apply the first tip
  • #5: With this simple trick you can multiply by 7 your productivity.. Instead of 7 characters you will just type 1. Be careful of not sharing this with your employer or your salary might go down. Notice that this can be automated to be the default in your shell if you add this command to your .bashrc or .zshrc file. You can follow the research link in the bottom for more information about how this technique saved 100 million dollars to a very big local company.
  • #6: Next step is go crazy on your TAB key, be careful because this can damage your keyboard if you abuse of this tip. With completion we use a set of scripts to automatically give us options and speed up writing long commands, where sometimes we don’t actually know what we want to get. Example here.. K get p plus tab gives us all the available resources that start with p.
  • #7: A little bit of more context. When working heavily with Kubernetes you will end up with multiple cluster and tons of namespaces. Knowing how to navigate between them is important Two main concepts: Context -> Which Kubernetes Master are you connected to. Namespaces -> Kubectl will filter all the resourced listed based on the current namespace.
  • #8: Now if you want to switch between different contexts (different kubernetes clusters) you can use the following commands. And you can see in the screen here how many tabs do I need in order to craft this very long command. This is not efficient.. Even with auto completion it get tedious quite fast.
  • #9: We can do this more efficiently by creating a more advanced alias, which use command line fuzzy finder, (a shell utility) in order to provide you the options and then selection using our arrows.
  • #10: If you want to avoid creating your own aliases and not using tools that other people is using, you can use kubectx and kubens to switch with style. You can see here that you have some extra features such as going back to the previous one with dash, and also creating aliases to long names.
  • #11: Going back to aliases.. Why creating our own if we can just get 800+ autogereated ones based on conventions? With this one.. We save time or we just go crazy. These aliases work based on taking pieces of information from the different parts of your command. Let’s see an example
  • #12: So k g poo what? I am not getting any poo here.. You can see my head exploding while creating the GIF here.. But really I’ve seen people using this efficiently, and when you are issuing tons of complex commands this might be worth the brain investment.
  • #13: Finally, plugins.. If you are already using these tips and you want to go an extra step forward you can write your own custom plugins to kubectl These are shell scripts that are going to be invoked on top of kubectl, you can add more complex rules or defaults in your own plugins.
  • #14: Finally, why creating your own plugin if you can look the most popular plugins out there using Krew. Krew itself is a plugin, which is nice and interesting. And if you don’t find what you are looking for and you decide to write your own plugin, make sure that you publish it in Krew for other people to find it.
  • #15: In summary we went through the journey of aliases, completion, getting poo.. Not poo.. Just 800+ generated aliases following conventions and we ended up with with plugins inception with Krew.
  • #16: In summary we went through the journey of aliases, completion, getting poo.. Not poo.. Just 800+ generated aliases following conventions and we ended up with with plugins inception with Krew.