When using kubectl, for various operations a namespace is required. Typically it uses default as the default namespace, and a different namespace can be set using -n. But in my work, all resources relevant to me are in a team-namespace, so I never use the default namespace for anything and always have to use -n <my-team-namespace>.
How can I set <my-team-namespace> as the default so that I don't need to use the -n option?
I'm not interested in installing anything extra.
Note: this is part of a series of posts meant to import relevant answers from other Stack Exchange sites here to make them easier to find, and also make it easier to handle duplicates as cross-site duplicates aren't a thing.