Unset namespace from Current-context

5/7/2020

I have set the namespace to current context like below

kubectl config set-context --current --namespace=ns1

I tried to unset the namespace from current context , but it dint work.

I am looking for help, Could you please share me the command to unset the namespace to default .

-- args
kubernetes

1 Answer

5/7/2020
kubectl config set-context --current --namespace=default

or

kubectl config unset contexts.name-or-your-current-context.namespace

Both will result in usage of the default namespace for the current context.

-- Fritz Duchardt
Source: StackOverflow