zimfw / k

All kubectl aliases in one function.
MIT License
4 stars 2 forks source link
kubectl zim zimfw zsh zsh-plugin zsh-plugins

k

All kubectl aliases in one function. Also initializes kubectl completion if it was not initialized.

usage: k <keys> [args...]

The keys parameter is composed of:

all typed sequentially without spaces. Longer keys have precedence over shorter keys. E.g pvc has precedence over pv.

Commands

Key Command
a apply
c create
d describe
e edit
E exec
g get
h help
k kustomize
l logs
t top
v version
x delete

Resources

Key Resource
apis apiservice
bi binding
cj cronjob
cm configmap
cr clusterrole
crb clusterrolebinding
crd customresourcedefinition
crv controllerrevision
cs componentstatus
csid csidriver
csin csinode
csisc csistoragecapacity
csr certificatesigningrequest
de deployment
ds daemonset
ep endpoint
eps endpointslice
ev event
fs flowschema
hpa horizontalpodautoscaler
ic ingressclass
ing ingress
jo job
le lease
lr limitrange
lsarv localsubjectaccessreview
mwc mutatingwebhookconfiguration
no node
np networkpolicy
ns namespace
pc priorityclass
pdb poddisruptionbudget
plc prioritylevelconfiguration
po pod
psp podsecuritypolicies
pt podtemplate
pv persistentvolume
pvc persistentvolumeclaim
rb rolebinding
rc replicationcontroller
ro role
rq resourcequota
rs replicaset
rtc runtimeclass
sa serviceaccount
sarv subjectaccessreview
sc storageclass
sec secret
ssarv selfsubjectaccessreview
ssrrv selfsubjectrulesreview
sts statefulset
svc service
tr tokenrequest
trv tokenreview
va volumeattachment
vo volume
vwc validatingwebhookconfiguration

Options

Key Option
A --all-namespaces
a --all
h --help
oj -o=json
on -o=name
ow -o=wide
oy -o=yaml
sl --show-labels
w --watch

Suffixes

Key Suffix
f -f
k -k
l -l

Examples

Input Output
k af pod.json kubectl apply -f pod.json
k dpol name=myLabel kubectl describe pod -l name=myLabel
k gk dir/ kubectl get -k dir/
k gpoowA kubectl get pod -o=wide --all-namespaces
k gsvcrc kubectl get service,replicationcontroller
k xpoa kubectl delete pod --all