diff --git a/bash/bashrc/sources/10_aliases b/bash/bashrc/sources/10_aliases index 3879791..cb5b644 100755 --- a/bash/bashrc/sources/10_aliases +++ b/bash/bashrc/sources/10_aliases @@ -38,3 +38,6 @@ alias ssh-add="ssh-add -t 43200" # Pretty print sqlite3 alias sqlite3="sqlite3 -header -column" + +# Kubernetes +alias kconf='kubectl config' diff --git a/bash/bashrc/sources/12_shortcuts b/bash/bashrc/sources/12_shortcuts index 0767d74..a1f74a3 100755 --- a/bash/bashrc/sources/12_shortcuts +++ b/bash/bashrc/sources/12_shortcuts @@ -14,3 +14,14 @@ function git-config-as { echo "Configured as \"$NAME <$EMAIL>\"" } +# Kubernetes +function kres { + local _O _D + _O="-ocustom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name" + _D="[0-9A-Za-z\-]" + if [ -z "$3" ]; then + kubectl get $1 -A $_O | grep "$2" + else + kubectl get $1 -A $_O | grep "$_D*$2$_D*\s\+$_D*$3$_D*" + fi +}