简体   繁体   English

如何获取新Azure群集的kubernetes凭据?

[英]How to get kubernetes credentials for new Azure cluster?

I deleted my old resource group with my k8s cluster, and made a new one and now kubectl can't get the new cluster's credentials. 我用k8s集群删除了旧的资源组,并创建了一个新的资源组,现在kubectl无法获得新集群的凭据。

When I run 当我跑步

>az acs kubernetes get-credentials --resource-group=myresourcegroup --name=mycluster   

    [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Traceback (most recent call last):
  File "C:\Users\me\AppData\Roaming\Python\Python35\site-packages\azure\cli\main.py", line 37, in main
    cmd_result = APPLICATION.execute(args)
  File "C:\Users\me\AppData\Roaming\Python\Python35\site-packages\azure\cli\core\application.py", line 157, in execute
    result = expanded_arg.func(params)
  File "C:\Users\me\AppData\Roaming\Python\Python35\site-packages\azure\cli\core\commands\__init__.py", line 358, in _execute_command
    raise ex
  File "C:\Users\me\AppData\Roaming\Python\Python35\site-packages\azure\cli\core\commands\__init__.py", line 353, in _execute_command
    result = op(client, **kwargs) if client else op(**kwargs)
  File "C:\Users\me\AppData\Roaming\Python\Python35\site-packages\azure\cli\command_modules\acs\custom.py", line 613, in k8s_get_credentials
    _k8s_get_credentials_internal(name, acs_info, path, ssh_key_file)
  File "C:\Users\me\AppData\Roaming\Python\Python35\site-packages\azure\cli\command_modules\acs\custom.py", line 631, in _k8s_get_credentials_internal
    '.kube/config', path_candidate, key_filename=ssh_key_file)
  File "C:\Users\me\AppData\Roaming\Python\Python35\site-packages\azure\cli\command_modules\acs\acs_client.py", line 39, in SecureCopy
    ssh.connect(host, username=user, pkey=pkey)
  File "C:\Users\me\AppData\Roaming\Python\Python35\site-packages\paramiko\client.py", line 305, in connect
    retry_on_signal(lambda: sock.connect(addr))
  File "C:\Users\me\AppData\Roaming\Python\Python35\site-packages\paramiko\util.py", line 269, in retry_on_signal
    return function()
  File "C:\Users\me\AppData\Roaming\Python\Python35\site-packages\paramiko\client.py", line 305, in <lambda>
    retry_on_signal(lambda: sock.connect(addr))
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Version

>kubectl version
Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.0", GitCommit:"a16c0a7f71a6f93c7e0f222d961f4675cd97a46b", GitTreeState:"clean", BuildDate:"2016-09-26T18:16:57Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"windows/amd64"}
Unable to connect to the server: dial tcp: lookup me.eastus.cloudapp.azure.com: getaddrinfow: No such host is known.

I tried deleting my existing kube config file but got the same error. 我尝试删除现有的kube配置文件,但遇到相同的错误。 How can I connect kubectl with my new cluster? 如何将kubectl与新集群连接?

I have got this error before, It seems does not install kubernetes CLI correctly. 我之前遇到过此错误,似乎无法正确安装kubernetes CLI。 Please try this command to install CLI: 请尝试使用以下命令来安装CLI:

az acs kubernetes install-cli --install-location=C:\some\directory\kubectl.exe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从节点获取群集? - How to get cluster from a node? kubernetes 集群添加 windows 节点 - kubernetes cluster adding windows node 如何从作为群集节点的计算机上获取虚拟群集FQDN - How to get virtual cluster FQDN from a computer which is a node in a cluster Windows和Linux共同生活在Kubernetes集群中 - Windows & Linux living together in Kubernetes cluster Windows Server Core单个节点群集上的Kubernetes - Kubernetes on single Windows Server Core node cluster Pod 立即从 Jenkins 终止到 Kubernetes 集群 - Pods terminated immediately from Jenkins to Kubernetes cluster 在Windows上配置Kubectl以使用远程Kubernetes集群 - Configure kubectl to use a remote Kubernetes cluster on windows 将我的服务部署到 azure kubernetes 服务时,总是出现错误“部署‘xxx’超出其进度截止日期” - Always get error "deployment 'xxx' exceeded its progress deadline" when deploy my service to azure kubernetes service 如何获取当前的Windows用户名并禁用凭据提示? - How to get current windows username and disable the credentials prompting? 如何从Swing应用程序获取Windows登录凭据? - How to get windows logon credentials from a Swing application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM