Changing Default Namespaces Dynamically
alias k='kubectl'
_f(){
k get namespace $1 > /dev/null;
if [ $? -eq 1 ];
then
return $?;
fi;
k config set-context $(k config current-context) --namespace=$1;
echo "set namespace: $1 success"
}
alias ksn=_f
网友评论