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=kubectlsys=--namespace kube-system
- commands:
g=getd=describerm=deletea:apply -fex:exec -i -tlo: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:--allor--all-namespacesdepending on the commandsl:--show-labelsw=-w/--watch
- output format:
- value flags (should be at the end):
n=-n/--namespacef=-f/--filenamel=-l/--selector
Reference






0 comments:
Post a Comment