# Kubeconfig Contexts

> How do you switch between different Kubernetes clusters (and namespaces) with kubectl, and how is the kubeconfig file organised?

Canonical: https://www.internhack.in/learn/interview/kubernetes-orchestration/k8s-context-switching
Last updated: 2026-11-28

Difficulty: Beginner

## Question

How do you switch between different Kubernetes clusters (and namespaces) with kubectl, and how is the kubeconfig file organised?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

Kubeconfig, Context, KUBECONFIG, kubectl config, Namespaces

Previous: [Taint Effects](https://www.internhack.in/learn/interview/kubernetes-orchestration/k8s-taint-effects) · Next: [Viewing Logs](https://www.internhack.in/learn/interview/kubernetes-orchestration/k8s-logs-tailing) · [All of Kubernetes & Orchestration](https://www.internhack.in/learn/interview/kubernetes-orchestration)

## More Kubernetes & Orchestration questions

- [Executing in Pod](https://www.internhack.in/learn/interview/kubernetes-orchestration/k8s-exec-shell)
- [Node Maintenance](https://www.internhack.in/learn/interview/kubernetes-orchestration/k8s-drain-node)
- [Static Pods](https://www.internhack.in/learn/interview/kubernetes-orchestration/k8s-static-pods)
- [Service Discovery](https://www.internhack.in/learn/interview/kubernetes-orchestration/k8s-service-discovery)
- [Init Containers](https://www.internhack.in/learn/interview/kubernetes-orchestration/k8s-init-containers)
- [Soft vs. Hard Affinity](https://www.internhack.in/learn/interview/kubernetes-orchestration/k8s-affinity-soft-hard)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Kubernetes & Orchestration](https://www.internhack.in/learn/interview/kubernetes-orchestration)
