Skip to content

Commit

Permalink
remove function wrapper around kubectl alias registration
Browse files Browse the repository at this point in the history
  • Loading branch information
cornfeedhobo committed Oct 19, 2022
1 parent 00062bf commit 622420d
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions aliases/available/kubectl.aliases.bash
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
# shellcheck shell=bash
about-alias 'kubectl aliases'

function _set_pkg_aliases() {
if _command_exists kubectl; then
alias kc='kubectl'
alias kcgp='kubectl get pods'
alias kcgd='kubectl get deployments'
alias kcgn='kubectl get nodes'
alias kcdp='kubectl describe pod'
alias kcdd='kubectl describe deployment'
alias kcdn='kubectl describe node'
alias kcgpan='kubectl get pods --all-namespaces'
alias kcgdan='kubectl get deployments --all-namespaces'
# launches a disposable netshoot pod in the k8s cluster
alias kcnetshoot='kubectl run netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash'
fi
}

_set_pkg_aliases
if _command_exists kubectl; then
alias kc='kubectl'
alias kcgp='kubectl get pods'
alias kcgd='kubectl get deployments'
alias kcgn='kubectl get nodes'
alias kcdp='kubectl describe pod'
alias kcdd='kubectl describe deployment'
alias kcdn='kubectl describe node'
alias kcgpan='kubectl get pods --all-namespaces'
alias kcgdan='kubectl get deployments --all-namespaces'
# launches a disposable netshoot pod in the k8s cluster
alias kcnetshoot='kubectl run netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash'
fi

0 comments on commit 622420d

Please sign in to comment.