kubernetes节点无法连接到api服务器:拨打tcp:在127.0.0.53:53上查找kubernetes.default.svc:没有这样的主机 [英] kubernetes node cannot connect to api-server: dial tcp: lookup kubernetes.default.svc on 127.0.0.53:53: no such host

查看:1243
本文介绍了kubernetes节点无法连接到api服务器:拨打tcp:在127.0.0.53:53上查找kubernetes.default.svc:没有这样的主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在linux Academy上建立了3个节点.在控制平面上,我可以看到3个节点在运行.在两个工作程序节点中的任何一个上,我都尝试运行kubectl get nodes.最初,系统提示我未设置KUBERNETES_MASTER.

I've built 3 nodes on linux academy. On the control plane I can see 3 nodes running. On either of the two worker nodes I try to run kubectl get nodes. Initially I was prompted that KUBERNETES_MASTER was not set.

在工作程序节点内部,我尝试将其设置为在主服务器的/kube/config中找到的服务器值.因此在工作节点中:export KUBERNETES_MASTER=https://1.2.3.4:6443.当我尝试此操作然后再次尝试时,我得到Unable to connect to the server: x509: certificate signed by unknown authority

Inside the worker nodes, I've tried setting this to the server value found in /kube/config in master. So in worker node: export KUBERNETES_MASTER=https://1.2.3.4:6443. When I try this and then try again kubectl get nodes I get Unable to connect to the server: x509: certificate signed by unknown authority

我还尝试在工作节点中将其设置为export KUBERNETES_MASTER=https://kubernetes.default.svc.当我尝试这个然后再尝试kubectl get nodes时,我得到Unable to connect to the server: dial tcp: lookup kubernetes.default.svc on 127.0.0.53:53: no such host

I've also tried setting to export KUBERNETES_MASTER=https://kubernetes.default.svc in the worker nodes. When I try this and then try kubectl get nodes I get Unable to connect to the server: dial tcp: lookup kubernetes.default.svc on 127.0.0.53:53: no such host

知道我在做什么错吗?

推荐答案

我们通常将kubectl的配置保存到~/.kube/config的文件中,该文件同时包含主端点和证书.您可以轻松地从母版复制它.

We usually save configurations of kubectl to a file at ~/.kube/config, which contains both the master endpoint and certificate. You can easily copy it from masters.

并且,假设您的群集域为cluster.local,则kubernetes.default.svc的FQDN为kubernetes.default.svc.cluster.local.该域名是为部署在其中的工作负载设置的 群集,并且需要访问API服务器.这样,域名被设计为只能由kube-dns在群集中解析.

And, the FQDN of kubernetes.default.svc is kubernetes.default.svc.cluster.local assuming your cluster domain is cluster.local. This domain name is set for workloads that are deployed in clusters and need to access the API server. Such that, the domain name is designed to be resolved only in clusters by kube-dns.

对于集群外的进程,主机名或IP地址/VIP通常用作API服务器的端点.

For processes out of clusters, the hostname or IP address/VIP is often used as the endpoint of the API server.

这篇关于kubernetes节点无法连接到api服务器:拨打tcp:在127.0.0.53:53上查找kubernetes.default.svc:没有这样的主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆