Add version information to kubectl cheat sheet

This commit is contained in:
Marcelo Giles 2023-04-30 17:36:24 -07:00
parent f635ceea9a
commit 585024554c
No known key found for this signature in database
GPG Key ID: F79A638016E48DFE
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@ card:
This page contains a list of commonly used `kubectl` commands and flags.
These instructions are for Kubernetes {{< skew currentVersion >}}. To check the version, use the `kubectl version` command.
<!-- body -->
## Kubectl autocomplete
@ -85,7 +86,7 @@ kubectl config set-context gce --user=cluster-admin --namespace=foo \
kubectl config unset users.foo # delete user foo
# short alias to set/show context/namespace (only works for bash and bash-compatible shells, current context to be set before using kn to set namespace)
# short alias to set/show context/namespace (only works for bash and bash-compatible shells, current context to be set before using kn to set namespace)
alias kx='f() { [ "$1" ] && kubectl config use-context $1 || kubectl config current-context ; } ; f'
alias kn='f() { [ "$1" ] && kubectl config set-context --current --namespace $1 || kubectl config view --minify | grep namespace | cut -d" " -f6 ; } ; f'
```