kops 更新集群失败,“为 NS 记录执行 DNS 查找时出错”,“没有这样的主机”

kops update cluster failed with `error doing DNS lookup for NS records` `no such host`

环境

$ kops version
Version 1.18.2 (git-84495481e4)

Kubernetes Cluster Version: 1.18.10

我想做什么

我想在我的域中创建一个 Kubernetes 集群 xway.me

我找到 this article 并尝试了。

我创建了一个集群并尝试打印 terraform 文件作为输出但它失败了。

$ kops update cluster \
  --out=. \
  --target=terraform \
  --state s3://xway.me-kops \
  --name xway.me

error doing DNS lookup for NS records for "xway.me": lookup xway.me on 127.0.0.53:53: no such host

我试过的

Error doing DNS lookup for NS records when using a Private DNS zone #781

我加了--dns private

但是我得到了unknown flag: --dns

Installing Kubernetes on AWS with kops

现在我的resolv.conf来了

# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0
search ad.oit.ac.jp

我在 /etc/resolv.conf.

添加这段代码
search xway.me

然后我得到这个错误。

error doing DNS lookup for NS records for "xway.me": lookup xway.me on 127.0.0.53:53: server misbehaving

添加nameserver 8.8.8.8也失败了

error doing DNS lookup for NS records for "xway.me": lookup xway.me on 127.0.0.53:53: no such host

使用 kops 创建:

$ kops create cluster --name xway.me --state s3://xway.me-kops

cluster "xway.me" already exists; use 'kops update cluster' to apply changes

我想知道

如何才能成功 运行 kops update cluster?

当您使用私有 DNS 记录时,它们通常不会在本地解析。您需要一个托管在 VPC 中的 DNS 转发器,该 VPC 启用了私有 route53 记录。

kOps 记录不会暴露任何特别敏感的内容,但如果您不想使用 public 记录,可以选择使用 Gossip cluster.

不过有一个known issue with combining gossip with terraform