Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Merging multiple kube config files in to one

# If you already have multiple config files to connect to different clusters, you would like to merge them first. You can merge both the config file using syntax below

# Merge ~/.kube/config and ~/.kube/devClusterConfig in to new config /tmp/config
$ KUBECONFIG=~/.kube/config:~/.kube/devClusterConfig kubectl config view --flatten > /tmp/config

# Replace old config with new merged config
$ mv /tmp/config ~/.kube/config


#Switching the Kubernetes clusters using kubectl commands
$ kubectl config get-contexts

$ kubectl config use-context qa-aks-cluster
Source by www.visualstudiogeeks.com #
 
PREVIOUS NEXT
Tagged: #Merging #multiple #kube #config #files
ADD COMMENT
Topic
Name
9+5 =