Merge pull request #30740 from mtilson/patch-1
short alias to set/show namespace
This commit is contained in:
@@ -73,6 +73,10 @@ kubectl config set-context gce --user=cluster-admin --namespace=foo \
|
|||||||
&& kubectl config use-context gce
|
&& kubectl config use-context gce
|
||||||
|
|
||||||
kubectl config unset users.foo # delete user 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)
|
||||||
|
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'
|
||||||
```
|
```
|
||||||
|
|
||||||
## Kubectl apply
|
## Kubectl apply
|
||||||
|
|||||||
Reference in New Issue
Block a user