Last active
August 29, 2023 13:05
-
-
Save HairyMike/9c549b09c45a29bb58eb8c7f4818b3ee to your computer and use it in GitHub Desktop.
Handy aliases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These aliases depend on the following: az-cli, gum, kubectx, kubens | |
# Choose your Azure Account | |
alias azacc='choice=$(az account list -o tsv --query "[].name" | gum choose --selected="$(az account show --query "name" -o tsv)") && az account set --name "$choice"' | |
# Choose your Kubernetes Context | |
alias kctx='choice=$(kubectx | gum choose --selected=$(kubectx -c)) && kubectx "$choice"' | |
# Choose your Kubernetes Namespace | |
alias kns='choice=$(kubens | gum choose --selected=$(kubens -c)) && kubens "$choice"' | |
# Start bash shell on a Kubernetes Pod | |
alias ksh='choice=$(kubectl get pods -oname | gum filter) && kubectl exec -it "$choice" -- bash' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment