Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version of kubectl.exe that the command az acs kubernetes install-cli brings is incorrect #2506

Closed
minherz opened this issue Mar 14, 2017 · 21 comments
Labels
ACS az acs/aks/openshift Service Attention This issue is responsible by Azure service team.

Comments

@minherz
Copy link

minherz commented Mar 14, 2017

Hello,
Correct for today, executing CLI command az acs kubernetes install-cli downloads the 1.4.5 of the kubectl.exe while the server version is 1.5.3. As result, many commands of the kubernetes CLI do not work (see issue 392 in azure-engine).
Please, update the kubectl.exe binary with the latest (1.5) version.
The above issue has a link to 1.5.0 binary location.

@colemickens
Copy link
Contributor

@derekbekoe derekbekoe added the ACS az acs/aks/openshift label Mar 14, 2017
@minherz
Copy link
Author

minherz commented Mar 14, 2017

I tried it just now and a fresh downloaded copy prints
Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.5"

@colemickens
Copy link
Contributor

Then you probably need to update your CLI.

@colemickens
Copy link
Contributor

cc: @brendandburns

Should we just always pull the latest released kubectl binary (curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl)?

Or just try to make sure we update this in the CLI as we update the service?

@minherz
Copy link
Author

minherz commented Mar 14, 2017

My version of azure cli (by az --version) is

azure-cli (2.0.0)

acs (2.0.0)
appservice (0.1.1b5)
batch (0.1.1b4)
cloud (2.0.0)
component (2.0.0)
configure (2.0.0)
container (0.1.1b4)
core (2.0.0)
documentdb (0.1.1b2)
feedback (2.0.0)
iot (0.1.1b3)
keyvault (0.1.1b5)
network (2.0.0)
nspkg (2.0.0)
profile (2.0.0)
redis (0.1.1b3)
resource (2.0.0)
role (2.0.0)
sql (0.1.1b5)
storage (2.0.1)
vm (2.0.0)

Python (Windows) 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)]

@minherz
Copy link
Author

minherz commented Mar 14, 2017

It should match the kubernetes cluster that azure creates. I had problems due the fact that kubernetes cli was in lesser version than kubernetes cluster server.
Best case scenario will be that when az acs kubernetes install-cli is called it will align with the current version of kubernetes cluster that azure provides.

@minherz
Copy link
Author

minherz commented Mar 14, 2017

Mind that i am referencing Windows platform, so the path above (.../bin/**linux**/amd64/kubectl) is not valid. The .../v<version>/bin/**windows**/amd64/kubectl.exe should be used.

@colemickens
Copy link
Contributor

Yes, that's clear. Can you please try updating your CLI to latest? If we try to match the cluster, you may end up with weirdness. Say one cluster is on 1.5 and one is on 1.4. In that case, you still want the 1.5 client, not the 1.4 client. Hence why I suggest maybe we should just download latest.

And yeah, the code is already written to differentiate between the windows/mac/linux download links.

Newer clients should be backward compatible with older clusters.

@minherz
Copy link
Author

minherz commented Mar 14, 2017

Regarding different clusters, I am not sure that I follow. Do you mean that Azure means to support different versions of Kubernetes? Otherwise the version is same for all clusters.
I tried to upgrade it by calling pip install -U --user azure-cli and got

Exception:
Traceback (most recent call last):
  File "c:\program files\python\python35\lib\shutil.py", line 538, in move
    os.rename(src, real_dst)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'c:\\users\\leonidy\\appdata\\roaming\\python
\\python35\\site-packages\\azure\\cli\\command_modules\\network\\mgmt_express_route_circuit\\lib\\models\\__pycache__\\e
xpress_route_circuit_creation_client_enums.cpython-35.pyc' -> 'C:\\Users\\leonidy\\AppData\\Local\\Temp\\pip-a7zi87ql-un
install\\users\\leonidy\\appdata\\roaming\\python\\python35\\site-packages\\azure\\cli\\command_modules\\network\\mgmt_e
xpress_route_circuit\\lib\\models\\__pycache__\\express_route_circuit_creation_client_enums.cpython-35.pyc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python\python35\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\program files\python\python35\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "c:\program files\python\python35\lib\site-packages\pip\req\req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "c:\program files\python\python35\lib\site-packages\pip\req\req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "c:\program files\python\python35\lib\site-packages\pip\req\req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "c:\program files\python\python35\lib\site-packages\pip\utils\__init__.py", line 267, in renames
    shutil.move(old, new)
  File "c:\program files\python\python35\lib\shutil.py", line 552, in move
    copy_function(src, real_dst)
  File "c:\program files\python\python35\lib\shutil.py", line 251, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "c:\program files\python\python35\lib\shutil.py", line 115, in copyfile
    with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\leonidy\\AppData\\Local\\Temp\\pip-a7zi87ql-uninstal
l\\users\\leonidy\\appdata\\roaming\\python\\python35\\site-packages\\azure\\cli\\command_modules\\network\\mgmt_express
_route_circuit\\lib\\models\\__pycache__\\express_route_circuit_creation_client_enums.cpython-35.pyc'

The version of CLI after that remained 2.0.0

@colemickens
Copy link
Contributor

Maybe file a different issue for that then, I can't help debug the cli upgrade unfortunately.

@minherz
Copy link
Author

minherz commented Mar 14, 2017

I can only say that installing fresh new Azure CLI also installs v2.0.0 so I do not know what else should be updated (maybe pip repository) in order to get more recent CLI version.
BTW, what is the latest Azure CLI version?
Also if you claim that the latest version of Azure CLI downloads v1.5.1 of Kubernetes then the issue only with the way to install the latest Azure CLI.

@derekbekoe
Copy link
Member

@minherz The upgrade failure is due to windows file path limit (#1221 (comment))
Can you uninstall then install instead of upgrading?

@minherz
Copy link
Author

minherz commented Mar 14, 2017

Hi,
I reinstalled it. Indeed i got some modules upgraded (see below), but the call to az acs kubernetes install-cli still brings a client with version 1.4.5...

azure-cli (2.0.1)

acs (2.0.0)
appservice (0.1.1b5)
batch (0.1.1b4)
cloud (2.0.0)
component (2.0.0)
configure (2.0.0)
container (0.1.1b4)
core (2.0.1)
documentdb (0.1.1b2)
feedback (2.0.0)
find (0.0.1b1)
iot (0.1.1b3)
keyvault (0.1.1b6)
network (2.0.0)
nspkg (2.0.0)
profile (2.0.0)
redis (0.1.1b3)
resource (2.0.0)
role (2.0.0)
sql (0.1.1b6)
storage (2.0.1)
vm (2.0.0)

Python (Windows) 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)]

@derekbekoe
Copy link
Member

derekbekoe commented Mar 14, 2017

The latest acs module is 2.0.1.
https://pypi.python.org/pypi/azure-cli-acs

You can run pip install --upgrade azure-cli-acs
Include the --user param if you used that when installing the CLI.

@minherz
Copy link
Author

minherz commented Mar 14, 2017

Maybe, but the output is what I got after uninstall and install commands for the default pip repository.

@derekbekoe
Copy link
Member

$ pip uninstall azure-cli
$ pip install azure-cli

With the above, pip doesn't actually remove the acs module.
That's why when you reinstalled, you ended up with the same version you had before.

@brendandburns
Copy link
Member

@minherz perhaps the install location is different? I'd try where kubectl.exe to see if it is installed somewhere else in your $PATH

@minherz
Copy link
Author

minherz commented Mar 14, 2017

@derekbekoe actually the acs module was upgraded. if you will look to the first az version list in the beginning of the thread and then one below, you will see it was upgraded from v2.0.0 to v2.0.1

@brendandburns according to az cli help (az acs kubernetes install-cli) the default download location of kubectl.exe is C:\Program Files. I have it included in %PATH% env. variable. I delete previous kubernetes cli before executing the command and see a new file there after the command completes.

@brendandburns
Copy link
Member

brendandburns commented Mar 15, 2017

Fix is here:

#2517

In the meantime you can use:

az acs kubernetes install-cli --client-version=1.5.4 to download the latest.

@minherz
Copy link
Author

minherz commented Mar 15, 2017

Thank you. Now I see that the "problem" is in default value for --client-version parameter.

@bsiegel bsiegel added the Service Attention This issue is responsible by Azure service team. label Sep 26, 2018
@haroldrandom haroldrandom added ACS az acs/aks/openshift Service Attention This issue is responsible by Azure service team. labels Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ACS az acs/aks/openshift Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

6 participants