【问题标题】:The dns-controller Kubernetes deployment has not updated the Kubernetes cluster's - AWSdns-controller Kubernetes 部署尚未更新 Kubernetes 集群的 - AWS
【发布时间】:2019-06-28 13:39:03
【问题描述】:

我正在尝试在 aws 和 验证时一直失败。使用以下命令更新集群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 放置到路由 53,但它破坏了一切。

【问题讨论】:

  • 能否提供来自 kubernetes 集群的日志?
  • 您能否分享您为创建 kops 集群和 kops 配置所采取的步骤(不含敏感信息)?如果您遵循了一些指南/手册,请提供链接。

标签: kubernetes kubectl kops


【解决方案1】:

根据我的经验,如果您的 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"}`

【讨论】:

    【解决方案2】:

    由于 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。

    还要确保主服务器的私有 IP 针对api.internal.kube.mydomain.com 的 DNS 进行更新。否则,节点将进入网络不可用状态。

    【讨论】:

    • 更新由 dns-controller 自动处理的控制面板地址。如果一切正常,绝对没有理由进行任何手动更新。
    【解决方案3】:

    当我将自定义 instance_policies 应用于我的实例组时,这发生在我身上。

    Kops 控制器无权将其更改为您所在区域中的 Route 53 kops-controller.internal. dns 条目的原因。

    要解决此问题,请将此更改应用于您的主 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": [
                    "*"
                ]
            },
    ]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-20
      相关资源
      最近更新 更多