# Local k9s / kubeconfig
1. Find out where kubeconfig is remote
```bash=
[[ ! -z "$KUBECONFIG" ]] && echo "$KUBECONFIG" || echo "$HOME/.kube/config"
```
2. Copy remote kubeconfig to local machine
```bash=
rsync / scopy
```
3. Replace private IP Address to public IP address of the remote machine in remote kubeconfig
```bash=
in example, from:
server: https://10.0.2.4:6443
to:
server: https://51.140.96.207:6443
```
4. Find out where Kubeconfig is locally
```bash=
[[ ! -z "$KUBECONFIG" ]] && echo "$KUBECONFIG" || echo "$HOME/.kube/config"
```
5. Check if cluster name is unique locally, if not, then change that too in remote kubeconfig
6. Merge 2 kubeconfigs and flatten them
```bash=
https://stackoverflow.com/questions/46184125/how-to-merge-kubectl-config-file-with-kube-config
```