<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ cat example.json
{
  &quot;kind&quot;: &quot;Pod&quot;,
  &quot;apiVersion&quot;: &quot;v1&quot;,
  &quot;metadata&quot;: {
    &quot;name&quot;: &quot;example&quot;,
  },
  &quot;spec&quot;: {
    &quot;containers&quot;: [
       {
          &quot;name&quot;: &quot;example&quot;,
          &quot;image&quot;: &quot;phusion/baseimage:latest&quot;,
          &quot;command&quot;: [
            &quot;echo&quot;, &quot;hello&quot;
          ],
       },
    ],
  }
}"><pre class="notranslate"><code class="notranslate">$ cat example.json
{
  "kind": "Pod",
  "apiVersion": "v1",
  "metadata": {
    "name": "example",
  },
  "spec": {
    "containers": [
       {
          "name": "example",
          "image": "phusion/baseimage:latest",
          "command": [
            "echo", "hello"
          ],
       },
    ],
  }
}
</code></pre></div>
<p dir="auto">(There's a syntax error in there somewhere, not sure where.)</p>
<p dir="auto">$ kubectl create -f example.json<br>
invalid character '}' looking for beginning of object key string</p>
<p dir="auto">kubectl should include the line and column number so I can fix my json.</p>
<p dir="auto">Kubernetes version v1.3.0</p>
<p dir="auto">Kubelet concatenates host /etc/resolv.conf and cluster domain entries for my pod, resulting in an invalid config (too many entries with duplicates). The max is only 6 search domains. Any more and DNS resolution breaks when trying to leverage search domains.</p>
<p dir="auto">The example below has only cluster DNS entries, but illustrates the issue:</p>
<p dir="auto">Host /etc/resolv.conf:<br>
search default.svc.cluster.local svc.cluster.local cluster.local<br>
nameserver 10.233.0.2<br>
nameserver 10.90.0.1<br>
options timeout:2<br>
options attempts:2</p>
<p dir="auto">Container /etc/resolv.conf:<br>
kubectl run -i --tty busybox --image=busybox -- sh<br>
(skip waiting text)<br>
/ # cat /etc/resolv.conf<br>
search default.svc.cluster.local svc.cluster.local cluster.local default.svc.cluster.local svc.cluster.local cluster.local<br>
nameserver 10.233.0.2<br>
options attempts:2<br>
options ndots:5</p>
<p dir="auto">I should be enable cluster DNS config in my host DNS settings and still have functional pod DNS. Kubelet should be intelligent enough to filter out duplicate search domain entries (or drop search domains beyond the 6th entry)</p>