Difference between revisions of "Merge multiple kubeconfigs"
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
* {{konfig}} | * {{konfig}} | ||
* {{kubeconfig}} | * {{kubeconfig}} | ||
+ | |||
+ | [[Category:K8s]] |
Revision as of 09:35, 12 January 2024
~/.kube/config into one using kubectl konfig merge
cp ~/.kube/config ~/.kube/config.BAK.$(date '+%Y-%m-%d_%H%M') kubectl konfig merge file1.yml file2.yml > merged_file.yml
for CLUSTER in $(rancher cluster ls | grep -v NAME | cut -d"*" -f2- | awk '{print $3}' ); do rancher cluster kubeconfig $CLUSTER > $CLUSTER.kubeconfig; done
Related
date: date '+%Y-%m-%d_%H%M'
See also
Advertising: