Cannot authenticate to kubectl using the CLI on Windows

Connecting your product cluster to the kubectl command line by using cloudctl fails on Windows.


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.


Windows is not correctly converting the kube-config file that the command downloads to a .bat file.

Resolving the problem

  1. Change the file name from C:\Users\<your_account>\.cloudctl\clusters\mycluster\kube-config to C:\Users\<your_account>\.bluemix\plugins\icp\clusters\mycluster\kube-config.bat.
  2. Run the C:\Users\<your_account>\.cloudctl\clusters\mycluster\kube-config.bat file. You can run kubectl commands against your cluster.