<p>I´m trying to set an additional nameserver for a deployment on gcloud Kubernetes like this:</p>

<pre><code>  dnsConfig:
    nameservers:
    - 172.16.248.32
    searches:
    - ns1.svc.cluster.local
    - mynetwork.local
    options:
    - name: ndots
      value: "2"
    - name: edns0
</code></pre>

<p>This fails with the following error:</p>

<blockquote>
  <p>spec.template.spec.dnsConfig: Forbidden: DNSConfig: custom pod DNS is
  disabled by feature gate</p>
</blockquote>

<p>How can I fix this?</p>

Alex Tbk
<p>Just a bit of background on why:</p>

<blockquote>
  <p>spec.template.spec.dnsConfig: Forbidden: DNSConfig: custom pod DNS is disabled by feature gate</p>
</blockquote>

<p>Starting with Kubernetes 1.10 the <code>CustomPodDNS</code> feature became beta and enabled by default. You would have had to add <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/" rel="nofollow noreferrer"><code>--feature-gates=CustomPodDNS=true</code></a> to the kube-apiserver and kubelets for this to work on Kubernetes 1.9 and earlier:</p>

<p><a href="https://i.stack.imgur.com/atFFr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/atFFr.png" alt="header"></a>
<a href="https://i.stack.imgur.com/v9So8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v9So8.png" alt="feature gate"></a></p>
