<h1>Envs</h1>
<pre><code>$ kops version
Version 1.18.2 (git-84495481e4)

Kubernetes Cluster Version: 1.18.10
</code></pre>
<h1>What I want to do</h1>
<p>I want to create a Kubernetes cluster at my domain <code>xway.me</code>.</p>
<p>I found <a href="https://zerotoprod.com/posts/k8s-on-aws-kops-terraform/" rel="nofollow noreferrer">this article</a> and try that.</p>
<p>I created a cluster and tried to print the terraform file as output but it failed.</p>
<pre><code>$ kops update cluster \
  --out=. \
  --target=terraform \
  --state s3://xway.me-kops \
  --name xway.me

error doing DNS lookup for NS records for &quot;xway.me&quot;: lookup xway.me on 127.0.0.53:53: no such host
</code></pre>
<h1>What I tried</h1>
<p><a href="https://github.com/kubernetes/kops/issues/781" rel="nofollow noreferrer">Error doing DNS lookup for NS records when using a Private DNS zone #781</a></p>
<p>I add the <code>--dns private</code></p>
<p>But I got <code>unknown flag: --dns</code>.</p>
<p><a href="https://deepdive.tw/2017/01/04/installing-kubernetes-on-aws-with-kops/" rel="nofollow noreferrer">Installing Kubernetes on AWS with kops</a></p>
<p>Now my resolv.conf is here</p>
<pre><code># 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 &quot;systemd-resolve --status&quot; 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
</code></pre>
<p>I add this code in the /etc/resolv.conf.</p>
<pre><code>search xway.me
</code></pre>
<p>Then I got this error.</p>
<pre><code>error doing DNS lookup for NS records for &quot;xway.me&quot;: lookup xway.me on 127.0.0.53:53: server misbehaving
</code></pre>
<p>adding <code>nameserver 8.8.8.8</code> is also failed</p>
<pre><code>error doing DNS lookup for NS records for &quot;xway.me&quot;: lookup xway.me on 127.0.0.53:53: no such host
</code></pre>
<p>using kops create:</p>
<pre><code>$ kops create cluster --name xway.me --state s3://xway.me-kops

cluster &quot;xway.me&quot; already exists; use 'kops update cluster' to apply changes
</code></pre>
<h1>I want to know</h1>
<p>How can I succeed in running <code>kops update cluster</code>?</p>

Asuha
<p>When you are using private DNS records, they will not typically resolve locally. You need a DNS forwareder hosted in a VPC that has the private route53 record enabled.</p>
<p>The kOps record doesn't expose anything particularly sensitive, but if you do not want to use a public record, an option is to use a <a href="https://kops.sigs.k8s.io/gossip/" rel="nofollow noreferrer">Gossip cluster</a>.</p>
<p>There is a <a href="https://github.com/kubernetes/kops/issues/2990" rel="nofollow noreferrer">known issue with combining gossip with terraform</a> though.</p>
