Kubectl Set-context | Namespace

The --all-namespaces flag (or -A ) explicitly overrides any namespace setting—including the context default—and operates across all namespaces. This is consistent with the precedence rule: the imperative flag takes highest priority.

The use of the --current flag is particularly significant. It tells kubectl to apply the change to the context currently active in the shell session, effectively setting the default namespace for all subsequent commands. Alternatively, a user can specify a context name to modify a configuration without switching to it immediately. kubectl set-context namespace