If your Alibaba Cloud account has access to multiple clusters, you can run the following command to combine kubeconfig files of different clusters into one credential file:
KUBECONFIG=file1:file2:file3 kubectl config view --merge --flatten > ~/.kube/all-config
export KUBECONFIG=~/.kube/all-config
  • Run the following command to view the available contexts:
    kubectl config get-contexts
  • Run the following command to view the help information:
    kubectl config --help
  • Run the following command to change the contexts:
    kubectl config use-context {your-contexts}
For more information about kubeconfig files, see Configure access to multiple clusters.
Note You can obtain kubeconfig access credentials of the current user on the cluster list page of the Container Service console. You can also call an API action to obtain a specific kubeconfig file.