<p>I have a problem with <code>k8s</code> hosted on my own bare-metal infrastructure.</p>
<p>The k8s was installed via <code>kubeadm init</code> without special configuration, and then I apply <code>CNI</code> <a href="https://www.weave.works/docs/net/latest/kubernetes/kube-addon/#-installation" rel="nofollow noreferrer">plugin</a></p>
<p>Everything works perfectly expects external DNS resolution from <code>Pod</code> to the external world (internet).</p>
<p>For example:</p>
<p>I have <code>Pod</code> with the name <code>foo</code>, if I invoke command <code>curl google.com</code> I receive error
<code>curl: (6) Could not resolve host: google.com</code></p>
<p>but if I invoke the same command on the same pod a second time I receive properly HTML</p>
<pre><code>&lt;HTML&gt;&lt;HEAD&gt;&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html;charset=utf-8&quot;&gt;
&lt;TITLE&gt;301 Moved&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;
&lt;H1&gt;301 Moved&lt;/H1&gt;
The document has moved
&lt;A HREF=&quot;http://www.google.com/&quot;&gt;here&lt;/A&gt;.
&lt;/BODY&gt;&lt;/HTML&gt;
</code></pre>
<p>and if I repeat this command again I can receive errors with DNS resolution or HTML and so on.
this behavior is random sometimes I must hit 10times and get an error and on 11 hits I can receive Html</p>
<p>I also try to debug this error with <a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/" rel="nofollow noreferrer">this</a> guide, but it does not help.</p>
<p>Additional information:
CoreDNS is up and running and have default config</p>
<pre><code>apiVersion: v1
data:
  Corefile: |
    .:53 {
        errors
        health {
           lameduck 5s
        }
        ready
        kubernetes cluster.local in-addr.arpa ip6.arpa {
           pods insecure
           fallthrough in-addr.arpa ip6.arpa
           ttl 30
        }
        prometheus :9153
        forward . /etc/resolv.conf {
           max_concurrent 1000
        }
        cache 30
        loop
        reload
        loadbalance
    }
kind: ConfigMap
metadata:
  name: coredns
</code></pre>
<p>and files <code>/etc/resolv.conf</code> looks fine</p>
<pre><code>nameserver 10.96.0.10
search default.svc.cluster.local svc.cluster.local cluster.local 
options ndots:5
</code></pre>
<p>the problem exists on <code>Centos 8</code>(master, <code>kubeadm init</code>)  and on <code>Debian 10</code>(node, <code>kubeadm join</code>)
<code>SELinux</code> in on <code>permissive</code> and <code>SWAP</code> is disabled</p>
<p>it is looks like after install k8s and weavenet problem appear even on the host machine.</p>
<p>I'm not certain where the problem came from either k8s or Linux.
It started after I have installed k8s.</p>
<p>what have I missed?</p>

Michał Konieczny
<p>I can suggest using different CNI plugin and setting it up from scratch. Remember when using <code>kubeadm</code> , apply CNI plugin after you ran <code>kubeadm init</code>, then add worker nodes. <a href="https://kubernetes.io/docs/concepts/cluster-administration/networking/#how-to-implement-the-kubernetes-networking-model" rel="nofollow noreferrer">Here</a> you can find supported CNI plugins. If the problem still exists, it's probably within your OS.</p>
