kubectl productivity
Auto Complete
source <(kubectl completion bash) # setup autocomplete in bash into the current shell, bash-completion package should be installed first.
echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell.
Context
kubectx
helps you switch between clusters back and forth:kubens
helps you switch between Kubernetes namespaces smoothly:
Explain
kubectl explain
command outputs the specification of the requested resource or field.
Alias
A script to generate hundreds of convenient kubectl aliases programmatically.
Syntax explanation
k
=kubectl
sys
=--namespace kube-system
- commands:
g
=get
d
=describe
rm
=delete
a
:apply -f
ex
:exec -i -t
lo
:logs -f
- resources:
po
=pod,dep
=deployment
,ing
=ingress
,svc
=service
,cm
=configmap
,sec
=secret
,ns
=namespace
,no
=node
- flags:
- output format:
oyaml
,ojson
,owide
all
:--all
or--all-namespaces
depending on the commandsl
:--show-labels
w
=-w/--watch
- output format:
- value flags (should be at the end):
n
=-n/--namespace
f
=-f/--filename
l
=-l/--selector
Reference
0 comments:
Post a Comment