I try to connect to Azure Container Service using:
az acs kubernetes browse --name <cluster-name> --resource-group <resource-group-name> --verbose --debug
I then get a timeout when connecting, same as when I use kubectl proxy. I have been able to connect before today.
Here is a snippet of my console output:
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.ContainerService/containerServices/<container-service-name>?api-version=2017-01-31'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger : 'Connection': 'keep-alive'
msrest.http_logger : 'Accept-Encoding': 'gzip, deflate'
msrest.http_logger : 'Accept': 'application/json'
msrest.http_logger : 'User-Agent': 'python/2.7.12 (Darwin-16.5.0-x86_64-i386-64bit) requests/2.14.2 msrest/0.4.7 msrest_azure/0.4.7 containerserviceclient/1.0.0rc1 Azure-SDK-For-Python AZURECLI/2.0.6'
msrest.http_logger : 'Authorization': '*****'
msrest.http_logger : 'x-ms-client-request-id': '********-****-****-****-************'
msrest.http_logger : 'CommandName': 'acs kubernetes browse'
msrest.http_logger : 'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger : 'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
requests.packages.urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
requests.packages.urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.ContainerService/containerServices/<container-service-name>?api-version=2017-01-31 HTTP/1.1" 200 None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger : 'Cache-Control': 'no-cache'
msrest.http_logger : 'Pragma': 'no-cache'
msrest.http_logger : 'Transfer-Encoding': 'chunked'
msrest.http_logger : 'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger : 'Content-Encoding': 'gzip'
msrest.http_logger : 'Expires': '-1'
msrest.http_logger : 'Vary': 'Accept-Encoding'
msrest.http_logger : 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger : 'x-ms-served-by': '********-****-****-****-************_******************'
msrest.http_logger : 'x-ms-request-id': '********-****-****-****-************'
msrest.http_logger : 'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
msrest.http_logger : 'x-ms-ratelimit-remaining-subscription-reads': '14973'
msrest.http_logger : 'x-ms-correlation-request-id': '********-****-****-****-************'
msrest.http_logger : 'x-ms-routing-request-id': 'WESTEUROPE:20170519T083857Z:********-****-****-****-************'
msrest.http_logger : 'Date': 'Fri, 19 May 2017 08:38:57 GMT'
msrest.http_logger : Response content:
msrest.http_logger : Body contains chunked data.
[Errno 60] Operation timed out
Traceback (most recent call last):
File "/Users/maci7/lib/azure-cli/lib/python2.7/site-packages/azure/cli/main.py", line 36, in main
cmd_result = APPLICATION.execute(args)
File "/Users/maci7/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/application.py", line 203, in execute
result = expanded_arg.func(params)
File "/Users/maci7/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 278, in __call__
return self.handler(*args, **kwargs)
File "/Users/maci7/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 473, in _execute_command
reraise(*sys.exc_info())
File "/Users/maci7/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 450, in _execute_command
result = op(client, **kwargs) if client else op(**kwargs)
File "/Users/maci7/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/custom.py", line 150, in k8s_browse
_k8s_browse_internal(name, acs_info, disable_browser, ssh_key_file)
File "/Users/maci7/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/custom.py", line 160, in _k8s_browse_internal
_k8s_get_credentials_internal(name, acs_info, browse_path, ssh_key_file)
File "/Users/maci7/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/custom.py", line 711, in _k8s_get_credentials_internal
'.kube/config', path_candidate, key_filename=ssh_key_file)
File "/Users/maci7/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/acs_client.py", line 49, in SecureCopy
ssh.connect(host, username=user, pkey=pkey)
File "/Users/maci7/lib/azure-cli/lib/python2.7/site-packages/paramiko/client.py", line 305, in connect
retry_on_signal(lambda: sock.connect(addr))
File "/Users/maci7/lib/azure-cli/lib/python2.7/site-packages/paramiko/util.py", line 269, in retry_on_signal
return function()
File "/Users/maci7/lib/azure-cli/lib/python2.7/site-packages/paramiko/client.py", line 305, in <lambda>
retry_on_signal(lambda: sock.connect(addr))
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
error: [Errno 60] Operation timed out
I found the issue for my case. The VM was a part of a virtual network that did not allow kubectl or SSH to connect.