dns-controller Kubernetes部署尚未更新Kubernetes集群的-AWS

时间:2019-02-04 18:49:28

标签: kubernetes kubectl kops

我正在尝试在AWS上安装一个kubernetes集群 验证时一直失败。使用以下命令更新集群kops update cluster cluster.foo.com --yes并发布运行信息  这个kops validate cluster

Using cluster from kubectl context: cluster.foo.com

Validating cluster cluster.api.com

INSTANCE GROUPS
NAME            ROLE    MACHINETYPE MIN MAX SUBNETS
master-eu-west-2a   Master  t2.medium   1   1   eu-west-2a
nodes           Node    t2.medium   2   2   eu-west-2a

NODE STATUS
NAME    ROLE    READY

VALIDATION ERRORS
KIND    NAME        MESSAGE
dns apiserver   Validation Failed

The dns-controller Kubernetes deployment has not updated the Kubernetes cluster's API DNS entry to the correct IP address.  The API DNS IP address is the placeholder address that kops creates: 203.0.113.123.  Please wait about 5-10 minutes for a master to start, dns-controller to launch, and DNS to propagate.  The protokube container and dns-controller deployment logs may contain more diagnostic information.  Etcd and the API DNS entries must be updated for a kops Kubernetes cluster to start.

Validation Failed

请帮助找到根本原因。

1。我尝试删除并重新创建多个时间,但这并没有帮助我。
2。还尝试手动将主公用IP和专用IP放置到路由53,但它破坏了所有内容。

2 个答案:

答案 0 :(得分:0)

根据我的经验,如果您在kops的版本以及kubectl和kubernetes平面版本上有差异,那么Kops将永远不会更新Route53肠版,对于我来说,您必须为所有版本都具有相同的版本

[root@ip-20-0-0-66 kuberneteswithkops]# kops version
Version 1.15.0 (git-9992b4055)
[root@ip-20-0-0-66 kuberneteswithkops]# kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:54Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}`

答案 1 :(得分:0)

由于 EC2 使用弹性 IP 地址作为公网 IP,每次您重新启动主节点时,它都会收到一个新的公网 IP。碰巧 KOPS 没有为 Kube API 获取新 IP。例如,如果您的集群名称是 kube.mydomain.com,则 API DNS 将是:api.kube.mydomain.com,正如您从 Route53 中看到的那样。

当您尝试访问集群时,您会看到超时错误:

 $ kops rolling-update cluster
Using cluster from kubectl context: kube.mydomain.com

Unable to reach the kubernetes API.
Use --cloudonly to do a rolling-update without confirming progress with the k8s API


error listing nodes in cluster: Get "https://api.kube.mydomain.com/api/v1/nodes": dial tcp 3.8.157.44:443: i/o timeout
$ 

要解决此问题:每次您的 EC2 主节点收到新的公共 IP 时,您都必须根据 Route53 中 api.kube.mydomain.com 的 DNS 手动更新公共 IP。

还要确保根据 api.internal.kube.mydomain.com 的 DNS 更新主站的私有 IP。否则,节点将进入网络不可用状态。