Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
bf5574fc
Unverified
Commit
bf5574fc
authored
Oct 21, 2020
by
Wenli Wan
Committed by
GitHub
Oct 21, 2020
Browse files
kubectl: add aliases for serviceaccount, daemonsets and cronjob (#9344)
parent
3f42700c
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/kubectl/README.md
View file @
bf5574fc
...
...
@@ -22,7 +22,7 @@ plugins=(... kubectl)
| kcsc |
`kubectl config set-context`
| Set a context entry in kubeconfig |
| kcdc |
`kubectl config delete-context`
| Delete the specified context from the kubeconfig |
| kccc |
`kubectl config current-context`
| Display the current-context |
| kcgc |
`kubectl config get-contexts`
| List of contexts available
| kcgc |
`kubectl config get-contexts`
| List of contexts available
| | |
**General aliases**
|
| kdel |
`kubectl delete`
| Delete resources by filenames, stdin, resources and names, or by resources and label selector |
| kdelf |
`kubectl delete -f`
| Delete a pod using the type and name specified in -f argument |
...
...
@@ -91,13 +91,13 @@ plugins=(... kubectl)
| keno |
`kubectl edit node`
| Edit nodes resource from the default editor |
| kdno |
`kubectl describe node`
| Describe node resource in detail |
| kdelno |
`kubectl delete node`
| Delete the node |
| | |
**Persistent Volume Claim management**
|
| |
|
**Persistent Volume Claim management**
|
| kgpvc |
`kubectl get pvc`
| List all PVCs |
| kgpvcw |
`kgpvc --watch`
| After listing/getting the requested object, watch for changes |
| kepvc |
`kubectl edit pvc`
| Edit pvcs from the default editor |
| kdpvc |
`kubectl describe pvc`
| Desc
i
rbe all pvcs |
| kdpvc |
`kubectl describe pvc`
| Descr
i
be all pvcs |
| kdelpvc |
`kubectl delete pvc`
| Delete all pvcs matching passed arguments |
| | |
|
| | |
**StatefulSets management**
|
| kgss |
`kubectl get statefulset`
| List the statefulsets in ps format |
| kgssw |
`kgss --watch`
| After getting the list of statefulsets, watch for changes |
| kgsswide|
`kgss -o wide`
| After getting the statefulsets, output in plain-text format with any additional information |
...
...
@@ -106,6 +106,21 @@ plugins=(... kubectl)
| kdelss |
`kubectl delete statefulset`
| Delete the statefulset |
| ksss |
`kubectl scale statefulset`
| Scale a statefulset |
| krsss |
`kubectl rollout status statefulset`
| Check the rollout status of a deployment |
| | |
**Service Accounts management**
|
| kgsa |
`kubectl get sa`
| List all service accounts |
| kdsa |
`kubectl describe sa`
| Describe a service account in details |
| kdelsa |
`kubectl delete sa`
| Delete the service account |
| | |
**DaemonSet management**
|
| kgds |
`kubectl get daemonset`
| List all DaemonSets in ps output format |
| kgdsw |
`kgds --watch`
| After listing all DaemonSets, watch for changes |
| keds |
`kubectl edit daemonset`
| Edit DaemonSets from the default editor |
| kdds |
`kubectl describe daemonset`
| Describe all DaemonSets in detail |
| kdelds |
`kubectl delete daemonset`
| Delete all DaemonSets matching passed argument |
| | |
**CronJob management**
|
| kgcj |
`kubectl get cronjob`
| List all CronJobs in ps output format |
| kecj |
`kubectl edit cronjob`
| Edit CronJob from the default editor |
| kdcj |
`kubectl describe cronjob`
| Describe a CronJob in details |
| kdelcj |
`kubectl delete cronjob`
| Delete the CronJob |
## Wrappers
...
...
plugins/kubectl/kubectl.plugin.zsh
View file @
bf5574fc
...
...
@@ -150,6 +150,24 @@ alias kepvc='kubectl edit pvc'
alias
kdpvc
=
'kubectl describe pvc'
alias
kdelpvc
=
'kubectl delete pvc'
# Service account management.
alias
kgsa
=
"kubectl get sa"
alias
kdsa
=
"kubectl describe sa"
alias
kdelsa
=
"kubectl delete sa"
# DaemonSet management.
alias
kgds
=
'kubectl get daemonset'
alias
kgdsw
=
'kgds --watch'
alias
keds
=
'kubectl edit daemonset'
alias
kdds
=
'kubectl describe daemonset'
alias
kdelds
=
'kubectl delete daemonset'
# CronJob management.
alias
kgcj
=
'kubectl get cronjob'
alias
kecj
=
'kubectl edit cronjob'
alias
kdcj
=
'kubectl describe cronjob'
alias
kdelcj
=
'kubectl delete cronjob'
# Only run if the user actually has kubectl installed
if
((
${
+_comps[kubectl]
}
))
;
then
kj
()
{
kubectl
"
$@
"
-o
json | jq
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment