Set the default namespace for the current context: kubectl config set-context --current --namespace=<namespace>
Verify effective config: kubectl config view --minify shows only the current context's stanza
Smoke-test access: kubectl get pods (empty result is fine; auth/connection errors are not)
Multiple kubeconfig files merge via the KUBECONFIG env var (colon-separated paths); default file is ~/.kube/config
Official docs: https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/ and https://kubernetes.io/docs/reference/kubectl/generated/kubectl_config/
Known gotchas
use-context does not validate connectivity or credentials — errors only surface on the first real command against the cluster
Context names are case-sensitive exact matches; 'error: no context exists' usually means a typo or a different kubeconfig file than you think (check KUBECONFIG)
set-context --current edits only the current context; namespace defaults are per-context, not global
A context grants nothing by itself — RBAC still decides per user/namespace; being able to list contexts says nothing about cluster permissions
Automation tip: prefer explicit --context and -n flags in scripts over mutating shared kubeconfig state that other terminals/processes read
Give your agent this knowledge — and 17,100+ more routes
One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?