Cannot authenticate to kubectl using the CLI on Windows
Connecting your product cluster to the kubectl command line by using cloudctl fails on Windows.
Symptoms
When you run the cloudctl login
command and the following error is displayed:
Unable to rename file to bat extension: C:\Users\<your_account>`\.cloudctl\clusters\mycluster\kube-config
Where <your_account>
is the name of your Windows account.
Causes
Windows is not correctly converting the kube-config
file that the command downloads to a .bat
file.
Resolving the problem
- Change the file name from
C:\Users\<your_account>\.cloudctl\clusters\mycluster\kube-config
toC:\Users\<your_account>\.bluemix\plugins\icp\clusters\mycluster\kube-config.bat
. - Run the
C:\Users\<your_account>\.cloudctl\clusters\mycluster\kube-config.bat
file. You can run kubectl commands against your cluster.