# Changing kubeconfig pointer location

**URL:** <https://discuss.kubernetes.io/t/changing-kubeconfig-pointer-location/23623>\
**Category:** General Discussions\
**Created:** [March 28, 2023, 8:55am UTC](https://discuss.kubernetes.io/t/changing-kubeconfig-pointer-location/23623 "2023-03-28T08:55:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NikitaM](https://avatars.discourse-cdn.com/v4/letter/n/bb73d2/32.png) [@NikitaM](https://discuss.kubernetes.io/u/NikitaM)\
**Post date:** [March 28, 2023, 8:55am UTC](https://discuss.kubernetes.io/t/changing-kubeconfig-pointer-location/23623/1 "2023-03-28T08:55:34Z")

</div>

Hello,

I am setting up my kubernetes environment locally on ubuntu 20.04.5 terminal and when I try to switch contexts for example from context-A to context-B in a cluster - I get:  
Merged “context-B” as current context in C:\Users\my.user\.kube\config

The problem is that since az aks is pointing to kube config in C: and not in Ubuntu itself - the context doesn’t actually update and I still see resources from context-A.

How do I make it point at /home/myuser/.kube/config - ubuntu location, instead of the C: one?

Thank you!

### Cluster information:

Kubernetes version:  
Cloud being used: Azure  
Installation method: brew  
Host OS: Ubuntu

---

<div class="post-metadata">

**Author:** ![krishanshamod](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@krishanshamod](https://discuss.kubernetes.io/u/krishanshamod)\
**Post date:** [March 30, 2023, 3:00pm UTC](https://discuss.kubernetes.io/t/changing-kubeconfig-pointer-location/23623/2 "2023-03-30T15:00:33Z")

</div>

You can set the kubeconfig path by giving the path to the `KUBECONFIG` environment variable. You can do it by executing the following command.

```auto
export KUBECONFIG=/home/myuser/.kube/config

```

Or you can make it permanent by adding that line to the end of the `bashrc` file. You can use your favorite text editor to do that.

```auto
nano ~/.bashrc

```

And then execute the following command.

```auto
source ~/.bashrc

```
