<p>I am trying to install the nginx-ingress controller through Helm but I would like to use a custom nginx template. However, I am having trouble understanding how that works. According to the <a href="https://github.com/helm/charts/tree/master/stable/nginx-ingress" rel="nofollow noreferrer">docs</a> I can use a parameter called <code>controller.customTemplate.configMapName</code>. The description of the parameter is.</p>

<blockquote>
  <p>configMap containing a custom nginx template</p>
</blockquote>

<p>I created a ConfigMap containing the nginx template as follows</p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-template
data:
  nginx.tmpl: nginx.tmpl
</code></pre>

<p>The <code>nginx.tmpl</code> contains the nginx configuration + plus a custom header on every server block. I install the chart as follows:</p>

<pre><code>helm install stable/nginx-ingress --namespace kube-system --set controller.customTemplate.configMapName="nginx-template"
</code></pre>

<p>However, I'm getting the following error when running above command.</p>

<pre><code>Error: release listless-ant failed: Deployment.apps "listless-ant-nginx-ingress-controller" is invalid: [spec.template.spec.volumes[0].configMap.items[0].key: Required value, spec.template.spec.containers[0].volumeMounts[0].name: Not found: "nginx-template-volume"]
</code></pre>

<p>My question is, what am I doing wrong?</p>

Frank Levering
<p>The default location of nginx configuration template is <code>/etc/nginx/template/nginx.tmpl</code> And you will have to configure this as a volume mount.</p>

<p>You can follow the steps mentioned in the official docs in-case if you are using a custom nginx.conf  <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/custom-template/" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/custom-template/</a></p>
