Merging Multiple Kubeconfig Files
Merge
-
old (~/.kube/config)
-
new - some new_config
-
add one more test_config
BashKUBECONFIG=~/.kube/config:config_new kubectl config view --merge --flatten > config.new
BashKUBECONFIG=~/.kube/config:config_1:config_2 kubectl config view --merge --flatten > config.new
Backup - just in case :)
Bashmv $HOME/.kube/config $HOME/.kube/config.old
Bashcat config.new > ~/.kube/config
Export config | current context
Bashkubectl config view --minify --flatten
Bashkubectl config view --minify --flatten --context prod-pve