简体   繁体   English

SSH 到 Azure Kubernetes 的 VM 时出错

[英]Getting error while SSH to VM of Azure Kubernetes

Below is my version of azure-cli以下是我的 azure-cli 版本

az --version 

azure-cli 2.0.75 *天蓝色 cli 2.0.75 *

command-modules-nspkg 2.0.3命令模块-nspkg 2.0.3
core 2.0.75 *核心 2.0.75 *
nspkg 3.0.4 nspkg 3.0.4
telemetry 1.0.4遥测 1.0.4

Python location '/usr/local/Cellar/azure-cli/2.0.75/libexec/bin/python' Python 位置 '/usr/local/Cellar/azure-cli/2.0.75/libexec/bin/python'
Extensions directory '/Users/alexchun/.azure/cliextensions'扩展目录“/Users/alexchun/.azure/cliextensions”

Python (Darwin) 3.7.4 (default, Oct 12 2019, 18:55:28) [Clang 11.0.0 (clang-1100.0.33.8)] Python(达尔文)3.7.4(默认,2019 年 10 月 12 日,18:55:28)[Clang 11.0.0 (clang-1100.0.33.8)]

Legal docs and information: aka.ms/AzureCliLegal法律文档和信息:aka.ms/AzureCliLegal

I tried to follow this link but there is no vmss found.我试图按照这个链接,但没有找到vmss Then I tried to run az aks nodepool list --resource-group myResourceGroup --cluster-name myAKSCluster to double check whether I could find vmss information or not (as I enabled vmss when creating AKS) but with it required me to install aks-preview.然后我尝试运行az aks nodepool list --resource-group myResourceGroup --cluster-name myAKSCluster来仔细检查我是否可以找到 vmss 信息(因为我在创建 AKS 时启用了 vmss)但它要求我安装 aks-预览。

When I wanted to install az extension add --name aks-preview but with below error:当我想安装az extension add --name aks-preview但出现以下错误:

Unable to get extension index.无法获取扩展索引。
Please ensure you have network connection.请确保您有网络连接。 Error detail: HTTPSConnectionPool(host='aka.ms', port=443): Max retries exceeded with url: /azure-cli-extension-index-v1 (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert internal error')])")))错误详情:HTTPSConnectionPool(host='aka.ms', port=443): Max retries exceeded with url: /azure-cli-extension-index-v1 (Caused by SSLError(SSLError("bad handshake: Error([(') SSL 例程'、'ssl3_read_bytes'、'tlsv1 警报内部错误')])")))

Thus, I also tried this method to SSH Azure VM directly but failed.因此,我也尝试了这种方法来直接 SSH Azure VM 但失败了。 (I tried to SSH with manual created Ubuntu VM before successfully) (在成功之前,我尝试使用手动创建的 Ubuntu VM 进行 SSH)


Supplement: I recreated new AKS with VMSS (enable port 22) but still could not SSH to it:补充:我使用 VMSS(启用端口 22)重新创建了新的 AKS,但仍然无法通过 SSH 连接到它: 在此处输入图片说明

Faced error:面临的错误:

ssh: connect to host 5x.1xx.1xx.2xx port 22: Operation timed out ssh:连接到主机 5x.1xx.1xx.2xx 端口 22:操作超时

There is no External-IP and I SSH with Internal-IP but failed:没有外部 IP,我使用内部 IP SSH 但失败了: 在此处输入图片说明

For your issue, the steps in the link is no problem.对于您的问题,链接中的步骤没有问题。 When you check the VMSS with the command here:当您使用此处的命令检查 VMSS 时:

CLUSTER_RESOURCE_GROUP=$(az aks show --resource-group myResourceGroup --name myAKSCluster --query nodeResourceGroup -o tsv)
SCALE_SET_NAME=$(az vmss list --resource-group $CLUSTER_RESOURCE_GROUP --query [0].name -o tsv)

You need to use your own resource group which the AKS cluster in. And then, if there is no information about the VMSS, it means you do not enable the VMSS when you create the AKS cluster.您需要使用自己的 AKS 集群所在的资源组。然后,如果没有有关 VMSS 的信息,则表示您在创建 AKS 集群时没有启用 VMSS。 At this time, you just need to SSH the VMs using the means in that link.此时,您只需要使用该链接中的方法对 VM 进行 SSH 连接。

Finally, maybe you can upgrade the Azure CLI to the newest version, then try to install the extension again.最后,也许您可​​以将 Azure CLI 升级到最新版本,然后再次尝试安装扩展。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM