I've merged two kubeconfig files using:
export KUBECONFIG config-demo:config-demo-2
The contexts appear correctly with kubectl config view, but when switching to dev-ramp-up using:
Running kubectl auth whoami shows incorrect/missing user attributes.
Questions:
Any insights would be appreciated.
Solved! Go to Solution.
I would highly recommend kubectx to solve this issue, thats best suited for this issue.
# switch to another cluster that's in kubeconfig $ kubectx minikube Switched to context "minikube". # switch back to previous cluster $ kubectx - Switched to context "oregon". # rename context $ kubectx dublin=gke_ahmetb_europe-west1-b_dublin Context "gke_ahmetb_europe-west1-b_dublin" renamed to "dublin". # change the active namespace on kubectl $ kubens kube-system Context "test" set. Active namespace is "kube-system". # go back to the previous namespace $ kubens - Context "test" set. Active namespace is "default". # change the active namespace even if it doesn't exist $ kubens not-found-namespace --force Context "test" set. Active namespace is "not-found-namespace". --- $ kubens not-found-namespace -f Context "test" set. Active namespace is "not-found-namespace".
I would highly recommend kubectx to solve this issue, thats best suited for this issue.
# switch to another cluster that's in kubeconfig $ kubectx minikube Switched to context "minikube". # switch back to previous cluster $ kubectx - Switched to context "oregon". # rename context $ kubectx dublin=gke_ahmetb_europe-west1-b_dublin Context "gke_ahmetb_europe-west1-b_dublin" renamed to "dublin". # change the active namespace on kubectl $ kubens kube-system Context "test" set. Active namespace is "kube-system". # go back to the previous namespace $ kubens - Context "test" set. Active namespace is "default". # change the active namespace even if it doesn't exist $ kubens not-found-namespace --force Context "test" set. Active namespace is "not-found-namespace". --- $ kubens not-found-namespace -f Context "test" set. Active namespace is "not-found-namespace".