Kubectl Set-context -
kubectl get ns # Output shows resources in default namespace (or whatever is set) To change the default namespace for your current context to backend :
kubectl set-context development --cluster=staging-cluster This updates the development context to use staging-cluster instead of its original cluster. kubectl set-context modifies your kubeconfig file (usually ~/.kube/config ). You can see the changes directly: kubectl set-context
# Good: Relies on context namespace kubectl get pods kubectl get pods -n default 3. Verify Before You Execute Create a shell alias to show your current context in your prompt: kubectl get ns # Output shows resources in
The command kubectl set-context allows you to create or modify these profiles without ever touching a YAML file. The basic syntax is: kubectl set-context