Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kubernetes version information to the kubectl cheat sheet #40912

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion content/en/docs/reference/kubectl/cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ card:

This page contains a list of commonly used `kubectl` commands and flags.

{{< note >}}
These instructions are for Kubernetes v{{< skew currentVersion >}}. To check the version, use the `kubectl version` command.
{{< /note >}}
<!-- body -->

## Kubectl autocomplete
Expand Down Expand Up @@ -85,7 +88,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'
```
Expand Down