Difference between revisions of "Merge multiple kubeconfigs"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
 
   ~/.kube/configs into one using [[kubectl konfig merge]]
 
   ~/.kube/configs into one using [[kubectl konfig merge]]
  
 +
[[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
 
  for CLUSTER in $([[rancher cluster ls]] | grep -v NAME | cut -d"*" -f2- | awk '{print $3}' ); do [[rancher cluster kubeconfig]] $CLUSTER > $CLUSTER.kubeconfig; done

Revision as of 11:38, 11 October 2023

 ~/.kube/configs into one using kubectl konfig merge
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

Advertising: