short alias to set/show namespace

usage:
$ kn              # shows current namespace
$ kn default # switch to specified namespace
This commit is contained in:
mtilson
2021-12-05 14:54:13 +03:00
committed by GitHub
parent acac2240e8
commit 9c8367804c
@@ -73,6 +73,9 @@ kubectl config set-context gce --user=cluster-admin --namespace=foo \
&& kubectl config use-context gce
kubectl config unset users.foo # delete user foo
# short alias to set/show namespace (useful for CKAD/CKA exams)
alias kn='f() { [ "$1" ] && kubectl config set-context --current --namespace $1 || kubectl config view --minify | grep namespace ; } ; f'
```
## Kubectl apply