Azure-cli: az acs kubernetes install-cli should default to %programfiles%\kubernetes\kubectl.exe

Created on 25 Jan 2017  ·  10Comments  ·  Source: Azure/azure-cli

According to the docs: az acs kubernetes install-cli installs to C:\Program Files\kubectl.exe
Installs should not place exe's in the root of program files.
They should be placed in a sub directory.
Suggest:
C:\Program Files\kubernetes\kubectl.exe
Or, since this requires administrative privileges, perhaps install in a per user directory, that's already on path.

ACS Service Attention

Most helpful comment

I have the same issue with az cli 2.0.21, my workaround is

I copied kubectl.exe into C:\Program Files\Microsoft SDKs\Azure.NET SDK\v2.9\bin

All 10 comments

@SteveLasker Do you think that we should default to install system wide or install per-user?

Thanks
--brendan

@brendandburns considering we're trying to avoid admin requirements, perhaps moving to per-user is a better model. It's one less place a developer requires admin privileges to get started. It also means they're more secure by default if they don't require admin rights.

And should be added to PATH

+1 on both, FWIW.

@brendandburns any updates on this? Currently running az acs kubernetes install-cli then trying to o something like az acs kubernetes browse results in
Can not find kubectl executable in PATH

I have the same issue with az cli 2.0.21, my workaround is

I copied kubectl.exe into C:\Program Files\Microsoft SDKs\Azure.NET SDK\v2.9\bin

So ... is there a workarround for this ? I'm trying to install cli but i can't because of this error. ( when i specify install-location the same issue appears )

Hi folks, because I am fixing related #6928, I will also address this one as the potential fix will be the same. Here are my ideas:

  1. kubectl.exe will be copied to user home folder, say “c:\users\jon\.azure-kubectl”. Right now copying to “program files” is not ideal as it is still not in search PATH and also doing it requires elevation.
  2. After download, CLI will check whether it is in OS's PATH env variable. If not (likely first time download), CLI will emit out the following warning text:
Please add "C:\Users\jon\.azure-kubectl" to your search PATH so the `kubectl.exe` can be found. 2 options:
    1. Run "set PATH=%PATH%;C:\Users\jon\.azure-kubectl" or "$env:path += 'C:\Users\jon\.azure-kubectl'" for PowerShell. 
       It is good for the current command session.
    2. Update system PATH environment variable by following "Control Panel->System->Advanced->Environment Variables",
       and re-open the command window. It is once for all.

If you do the 2nd, then CLI will never warn any more.
Letting CLI update the PATH is doable by tweaking the PATH's registry value. I am not so sure whether we need to go that far, also, users still need to reopen the command window unless CLI broadcasts it which is a native Win/API invocation. But anyway, if you really like CLI to do this, please let me know.

Hello I got the same issue. I re-install the azure cli by using az aks install-cli. After that added the same in environmental variable. Make sure that you add the C:\Users.azure-kubectl" to your search path.

For current session, run Run "set PATH=%PATH%;C:\Users\achin.azure-kubectl" or "$env:path += 'C:\Users\achin.azure-kubectl'" for PowerShell.

For future, Update system PATH environment variable by following "Control Panel->System->Advanced->Environment Variables", and re-open the command window.

Hello I am getting the same issue. I re-install the azure cli also and while fire this command az aks install-cli. getting below

C:\Users\dell>az aks install-cli Downloading client to "C:\Users\dell.azure-kubectlkubectl.exe" from "https://storage.googleapis.com/kubernetes-release/release/v1.16.3/bin/windows/amd64/kubectl.exe" Please add "C:\Users\dell.azure-kubectl" to your search PATH so the kubectl.exe can be found. 2 options: 1. Run "set PATH=%PATH%;C:\Users\dell.azure-kubectl" or "$env:path += 'C:\Users\dell.azure-kubectl'" for PowerShell. This is good for the current command session. 2. Update system PATH environment variable by following "Control Panel->System->Advanced->Environment Variables", and re-open the command window. You only need to do it once

Was this page helpful?
0 / 5 - 0 ratings