Kubectl provides autocomplete support for bash which can save us lot of typing.
Bash on
Windows using Git bash
1. Install Git bash from https://git-scm.com/downloads if it is
not available in your computer
2. Navigate to “C:\Users\<yourname>” from Git bash cli
3. Run following command to get kubectl autocompletion bash
commands and save into “kubectl-completion.bash” file
4. Create or Update .bashrc file source
5. Restart Git bash and start typing kubectl get po (
press [TAB] key )
Bash on Windows using Conemu/Cmder
It is an another handy multi and split tab windows terminal.
It supports multiple command terminals like cmd, PowerShell, bash and etc.
1. Install Git bash from https://git-scm.com/downloads if it is
not available in your computer
2. Install Conemu from https://conemu.github.io/
if it is not available in your computer.
3. Open new Git Bash console from Conemu terminal
4. Navigate to “C:\Users\<yourname>”
5. Run following command to get kubectl autocompletion bash
commands and save into “kubectl-completion.bash” file
6. Create or Update .bashrc file source
7. Restart Conemu terminal and start typing kubectl get po (
press [TAB] key )
Bash on Linux/macOS
Please go through below link to enable kubectl
autocompletion on Linux/macOS
https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion
- Kubernetes for Developers #25: PersistentVolume and PersistentVolumeClaim in-detail
- Kubernetes for Developers #24: Kubernetes Volume hostPath in-detail
- Kubernetes for Developers #23: Kubernetes Volume emptyDir in-detail
- Kubernetes for Developers #22: Access to Multiple Clusters or Namespaces using kubectl and kubeconfig
- Kubernetes for Developers #21: Kubernetes Namespace in-detail
- Kubernetes for Developers #20: Create Automated Tasks using Jobs and CronJobs
- Kubernetes for Developers #19: Manage app credentials using Kubernetes Secrets
- Kubernetes for Developers #18: Manage app settings using Kubernetes ConfigMap
- Kubernetes for Developers #17: Expose service using Kubernetes Ingress
- Kubernetes for Developers #16: Kubernetes Service Types - ClusterIP, NodePort, LoadBalancer and ExternalName
- Kubernetes for Developers #15: Kubernetes Service YAML manifest in-detail
- Kubernetes for Developers #14: Kubernetes Deployment YAML manifest in-detail
- Kubernetes for Developers #13: Effective way of using K8 Readiness Probe
- Kubernetes for Developers #12: Effective way of using K8 Liveness Probe
- Kubernetes for Developers #11: Pod Organization using Labels
- Kubernetes for Developers #10: Kubernetes Pod YAML manifest in-detail
- Kubernetes for Developers #9: Kubernetes Pod Lifecycle
- Kubernetes for Developers #8: Kubernetes Object Name, Labels, Selectors and Namespace
- Kubernetes for Developers #7: Imperative vs. Declarative Kubernetes Objects
- Kubernetes for Developers #6: Kubernetes Objects
- Kubernetes for Developers #5: Kubernetes Web UI Dashboard
- Kubernetes for Developers #4: Enable kubectl bash autocompletion
- Kubernetes for Developers #3: kubectl CLI
- Kubernetes for Developers #2: Kubernetes for Local Development
- Kubernetes for Developers #1: Kubernetes Architecture and Features
No comments:
Post a Comment