我正在尝试在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请帮助找出根本原因。
发布于 2020-03-22 20:32:45
根据我的经验,如果你的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"}`发布于 2021-02-14 02:15:36
由于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的域名系统更新主服务器的内网IP。否则,节点将进入网络不可用状态。
发布于 2022-02-25 02:08:56
当我将自定义instance_policies应用到我的实例组时,这种情况就发生在我身上。
原因是Kops控制器没有权限更改您区域中的路由53 kops-controller.internal.域名系统条目。
要解决此问题,请将此更改应用于您的主IAM角色。
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"route53:ChangeResourceRecordSets",
"route53:ListResourceRecordSets",
"route53:GetHostedZone"
],
"Effect": "Allow",
"Resource": [
"arn:aws:route53:::hostedzone/${hostedzone}"
]
},
{
"Action": [
"route53:GetChange"
],
"Effect": "Allow",
"Resource": [
"arn:aws:route53:::change/*"
]
},
{
"Action": [
"route53:ListHostedZones"
],
"Effect": "Allow",
"Resource": [
"*"
]
},
]https://stackoverflow.com/questions/54522497
复制相似问题