Kubectl get contexts6/24/2023 ![]() This will set the NEW_CONTEXT_NAME context as the current context, and you can use kubectl to manage the cluster associated with that context. You can then use the kubectl config use-context command to switch between the different contexts and manage the different clusters.įor example: kubectl config use-context NEW_CONTEXT_NAME This will merge the new config file with your existing config, adding any new contexts, users, or clusters that are defined in the file. Replace NEW_CONFIG_FILE with the path to your new config file. IMPORTANT: You must have a different context name or your configuration will be replaced! KUBECONFIG=~/.kube/config:/path/to/NEW_CONFIG_FILE kubectl config view -flatten > ~/.kube/config
0 Comments
Leave a Reply. |