Kubernetes on Azure : connectex



遵循链接的步骤,使用Azure门户创建K8S群集。尝试在远程计算机上使用kubectl检查它是否有效。有这个错误。

无法连接到服务器:拨号TCP 13.90.35.157:443:Connectex: 连接尝试失败了,因为连接的一方没有 一段时间后或已建立的连接适当做出响应 由于连接的主机无法响应而失败。

我可以向K8S大师使用。从主人尝试了kubectl get nodes并有类似的错误。

从这样的描述中说出什么问题真的很难说,但是由于这是一个新的群集(我这么说,因为有时K8S群集被部署了,但实际上并非如此因此,我建议删除它并创建一个新的,或使用Azure Cli Azure云外壳来创建它。

基本上就像:

一样简单
az acs create -n acs-cluster -g acsrg1 -d applink789 --generate-ssh-keys

如果您创建了资源组,则可以使用:

创建它。
az group create -n acsrg1 -l "westus"

根据您的描述,看来您的>未正确配置了服务主体。我使用错误的服务主体在Azure中部署K8,获取相同的错误:

C:Users>kubectl get nodes
Unable to connect to the server: dial tcp 13.90.27.73:443: connectex: 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.

您可能需要检查以确保准确提供凭据,并且配置的服务主体已读取并写入目标订阅的权限。如果您的服务校长被错误配置,那么Kubernetes组件都不会以健康的方式出现。我们可以检查是否有问题:

root@k8s-master-6FEE48E1-0:~# journalctl -u kubelet | grep --text autorest

如果您看到以下看起来如下的输出,则意味着您尚未正确配置服务主体。

root@k8s-master-6FEE48E1-0:~# journalctl -u kubelet | grep --text autorest
Jun 01 01:58:47 k8s-master-6FEE48E1-0 docker[5522]: E0601 01:58:47.447321    6028 kubelet.go:1186] Cannot get Node info: failed to get external ID from cloud provider: autorest#WithErrorUnlessStatusCode: POST https://login.microsoftonline.com/1fcf418e-66ed-4c99-9449-d8e18bf8737a/oauth2/token?api-version=1.0 failed with 400 Bad Request: StatusCode=400
Jun 01 01:58:47 k8s-master-6FEE48E1-0 docker[5522]: E0601 01:58:47.627128    6028 kubelet_node_status.go:70] Unable to construct api.Node object for kubelet: failed to get external ID from cloud provider: autorest#WithErrorUnlessStatusCode: POST https://login.microsoftonline.com/1fcf418e-66ed-4c99-9449-d8e18bf8737a/oauth2/token?api-version=1.0 failed with 400 Bad Request: StatusCode=400
Jun 01 01:58:47 k8s-master-6FEE48E1-0 docker[5522]: E0601 01:58:47.885092    6028 kubelet_node_status.go:70] Unable to construct api.Node object for kubelet: failed to get external ID from cloud provider: autorest#WithErrorUnlessStatusCode: POST https://login.microsoftonline.com/1fcf418e-66ed-4c99-9449-d8e18bf8737a/oauth2/token?api-version=1.0 failed with 400 Bad Request: StatusCode=400

有关如何创建/配置ACS-ENGIN KUBERNETES群集的服务主体的更多信息,请参阅此链接。

最新更新