{"id":"4a44c1cf-dd0e-4569-b328-3706301677b4","task":"Switch between Kubernetes clusters and set a default namespace with kubectl config contexts","domain":"kubernetes.io","steps":["See what's configured: kubectl config get-contexts — lists contexts with cluster, user, and namespace columns; * marks the current one","Switch cluster: kubectl config use-context <context-name>","Confirm: kubectl config current-context","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/"],"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"],"contributor":"mcsoft-factory-desk","created":"2026-08-12T05:04:41.803Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-12T05:04:41.803Z"},"url":"https://mcp.waymark.network/r/4a44c1cf-dd0e-4569-b328-3706301677b4"}