Skip to content

Instantly share code, notes, and snippets.

@irmiller22
Created April 14, 2022 19:59
Show Gist options
  • Save irmiller22/abd9161b7aac73eb3d92c082c4e38981 to your computer and use it in GitHub Desktop.
Save irmiller22/abd9161b7aac73eb3d92c082c4e38981 to your computer and use it in GitHub Desktop.
# Set up kubectl aliases
if command -v kubectl 1>/dev/null 2>&1; then
eval "source <(kubectl completion bash)"
alias kgnsi='k config set-context --current --namespace=$(kg ns -o json | jq -r ".items[].metadata.name"| fzf)'
test -e "${HOME}/.kubectl_aliases" && source "${HOME}/.kubectl_aliases"
fi
# Check secrets resources
if command -v kubectl 1>/dev/null 2>&1; then
function kdecsec() {
kubectl get secret $1 -o jsonpath="{.data}" | jq '.[] |= @base64d'
}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment