Azure-cli: Trying to connect to a kubernetes cluster on ACS

Created on 29 Sep 2017  ·  18Comments  ·  Source: Azure/azure-cli

Description

Trying to connect to a kubernetes cluster on ACS gives me the following error:

bash-4.3# az acs kubernetes get-credentials --resource-group doacskube --name doacskube
'proxycommand'
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/azure/cli/main.py", line 36, in main
    cmd_result = APPLICATION.execute(args)
  File "/usr/local/lib/python3.5/site-packages/azure/cli/core/application.py", line 212, in execute
    result = expanded_arg.func(params)
  File "/usr/local/lib/python3.5/site-packages/azure/cli/core/commands/__init__.py", line 377, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/lib/python3.5/site-packages/azure/cli/core/commands/__init__.py", line 626, in _execute_command
    reraise(*sys.exc_info())
  File "/usr/local/lib/python3.5/site-packages/six.py", line 693, in reraise
    raise value
  File "/usr/local/lib/python3.5/site-packages/azure/cli/core/commands/__init__.py", line 603, in _execute_command
    result = op(client, **kwargs) if client else op(**kwargs)
  File "/usr/local/lib/python3.5/site-packages/azure/cli/command_modules/acs/custom.py", line 814, in k8s_get_credentials
    _k8s_get_credentials_internal(name, acs_info, path, ssh_key_file)
  File "/usr/local/lib/python3.5/site-packages/azure/cli/command_modules/acs/custom.py", line 835, in _k8s_get_credentials_internal
    '.kube/config', path_candidate, key_filename=ssh_key_file)
  File "/usr/local/lib/python3.5/site-packages/azure/cli/command_modules/acs/acs_client.py", line 65, in secure_copy
    proxy = paramiko.ProxyCommand(host_config['proxycommand'])
KeyError: 'proxycommand'

Environment summary

Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here: docker, https://hub.docker.com/r/azuresdk/azure-cli-python/

CLI Version: What version of the CLI and modules are installed? (Use az --version)
Answer here:

bash-4.3# az --version
azure-cli (2.0.18+dev)

OS Version: What OS and version are you using?
Answer here: Docker

Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: Bash

ACS Service Attention bug

Most helpful comment

@derekbekoe, I made the fix. Let's see how we can get the fix out sooner.

All 18 comments

+1 on the same issue, same stack trace.

Installed via MSI, azure-cli (2.0.19), Windows 10 current build + Docker stable, running on CMD. Actually, I just installed azure-cli v2 from latest bits on MS website.

Disclaimer: I'm MS FTE, if you need a repro from a live computer

@rjtsdl

I am looking this. I may contact @vcx, but let me take a look first. :)

This has all our deployments completely blocked.

How do I install that a specific version of the Azure CLI? We are using this from the Azure documentation:

echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | tee /etc/apt/sources.list.d/azure-cli.list
apt-key adv --keyserver packages.microsoft.com --recv-keys 417A0893
apt-get -qq update && apt-get -qq install azure-cli

How do I install that a specific version of the Azure CLI?

You can down from https://packages.microsoft.com/repos/azure-cli/pool/main/a/azure-cli/ and then install manually. Would recommend removing the current version first.

e.g.

wget https://packages.microsoft.com/repos/azure-cli/pool/main/a/azure-cli/azure-cli_2.0.19-1_all.deb
dpkg -i azure-cli_2.0.19-1_all.deb

@derekbekoe, I made the fix. Let's see how we can get the fix out sooner.

What about release this fix? Any news?

The PR was merged two days ago. Next release is on 10/20. To try out the change early, you can use our edge feed.

@rjtsdl can we close this issue?

I cannot close :)

thanks @rjtsdl when applying your changes locally it worked :)

A workaround. Use 'az acs list' to get the 'masterProfile' 'fqdn' value and insert below for 'master-fqdn'. The following two commands should perform the action to copy down the config file from the cluster master node which 'az acs kubernetes get-credentials' is failing to perform. I tested this locally and it's working for me.

mkdir $HOME/.kube
scp azureuser@<master-fqdn>:.kube/config $HOME/.kube/config

This worked for me also...thanks a lot...you don't have to get the credential using get command in this case...

FWIW this is still erroring when using Azure Cloud shell, but naustin's workaround works ok.

Same problem, scp workaround successful. Did not have this issue on windows, only on ubuntu.

Just created a kubernets via azure-cli on azure portal. I get the same config missing error. But the scp workaround does not work. It returns permission denied. The public key on returns from az acs list is the same as at $HOME/.ssh/id_rsa.pub

any ideas?

Additional information:

1.azure-cli 2.0.19

  1. tested on 23/10/2017
  2. python 3.6.1

The next release azure-cli==2.0.20 will contain the fix in the ACS. The release will happen on Tuesday (10/24) in all channels including cloud shell.

Great!

On Mon, Oct 23, 2017 at 7:08 PM, Troy Dai notifications@github.com wrote:

The next release azure-cli==2.0.20 will contain the fix in the ACS. The
release will happen on Tuesday (10/24) in all channels including cloud
shell.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Azure/azure-cli/issues/4582#issuecomment-338710660,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAouEUYG7AdX3ZLM_K8E6c-CCWlBV1XOks5svLoFgaJpZM4PoJFO
.

This is now working 👍

Was this page helpful?
0 / 5 - 0 ratings