Add kubectl wrapper for convenience and safety
This commit is contained in:
parent
fff0b0016f
commit
1765917dba
2 changed files with 10 additions and 0 deletions
9
bin/kubectl-wrapper
Executable file
9
bin/kubectl-wrapper
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
cfg=.kubeconfig
|
||||
|
||||
path=$(pwd)
|
||||
while [[ "$path" != "" && ! -e "$path/$cfg" ]]; do
|
||||
path=${path%/*}
|
||||
done
|
||||
|
||||
exec env KUBECONFIG="$path/$cfg:$KUBECONFIG:$HOME/.kube/config" kubectl "$@"
|
Loading…
Add table
Add a link
Reference in a new issue