Logo

Armand.nz

Home / About / Linkedin / Github

Merge kube config files

#kubernetes #CKA #CKD |

Merge kube config files by doing the following:

export NEW="/path/to/new/config"
# Backup
cp ~/.kube/config ~/.kube/config.bak
# Flatten
export KUBECONFIG=~/.kube/config:$NEW
kubectl config view --flatten > /tmp/config && mv /tmp/config ~/.kube/config

Verify:

# List clusters
kubectl config get-clusters
kubectl config use-context [name]
comments powered byDisqus

Copyright © Armand