<p>For a first helm kubernetes deployment with minikube I am trying to set up a Ingress controller. The steps I did.</p>
<pre><code>Helm create ingress
</code></pre>
<p>Remove all files from templates folder and clear content of values.yaml and start with a fresh chart.yaml</p>
<pre><code>apiVersion: v2
name: ingress
description: A Helm chart for Ingress Controller
type: application
version: 1.1.0
appVersion: 1.17.0
keywords:
  - ingress
  - nginx
  - api-gateway
home: https://github.com/harry
maintainers:
  - name: Harry
    url: https://github.com/harry
dependencies:
  - name: nginx-ingress
    version: 0.15.1
    repository: https://helm.nginx.com/stable
</code></pre>
<p>Next a command that creates the tgz file</p>
<pre><code>helm dependency update
</code></pre>
<p>followed by a ingress.yaml in /templates</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {{ .Values.ingress.name }}
  annotations:
    kubernetes.io/ingress.class: {{ .Values.ingress.annotations.class }}
spec:
  rules:
  {{- range .Values.ingress.hosts }}
    - host: {{ .host | quote }}
      http:
        paths:
        {{- range .paths }}
          - path: {{ .path }}
            pathType: Prefix
            backend:
              service:
                name: {{ .backend.serviceName }}
                port:
                  number: {{ .backend.servicePort }}
        {{- end }}
  {{- end }}
</code></pre>
<p>And a default values.yaml</p>
<pre><code>ingress:
  name: ingress-service
  replicaCount: 1
  annotations: 
    class: nginx
  hosts:
    - host: chart-example.local
      paths: 
        - path: /
          backend:
            serviceName: serviceName
            servicePort: 8080
</code></pre>
<p>Lastly I apply with</p>
<pre><code>helm install -f ingress.yaml ingress ./ingress
</code></pre>
<p>the following ingress.yaml</p>
<pre><code>ingress:
  hosts:
    - host: nutrizone.k8s.com
      paths:
        - path: /api/
          backend:
            serviceName: trala-backend
            servicePort: 8080
        - path: /
          backend:
            serviceName: trala-ui
            servicePort: 8080
</code></pre>
<p><strong>Results</strong></p>
<pre><code>kubectl exec pod/ingress-nginx-ingress-controller-55b985bcfd-7p7hk -n default -- cat /etc/nginx/nginx.conf
</code></pre>
<p>where /api is nowhere to be found and</p>
<pre><code>location / {
    return 404;
  }
</code></pre>
<p>After reinstalling several times and updating to a newer version of nginx (which can be seen in the values.yaml - however old syntax should be converted correctly) I am a bit lost</p>
<p><strong>After first suggestion to update values.yaml</strong></p>
<p>I changed the block in values.yaml and parent ingress.yaml to nginx-ingress and updated the /template/ingress.yaml (i needed indexes to make the name 'nginx-ingress' work)</p>
<pre><code>helm delete ingress
helm install -f ingress.yaml ingress ./ingress
</code></pre>
<p>Sadly no difference.</p>
<p><strong>Update 2 add github project</strong>
<a href="https://github.com/Chris2301/helm" rel="nofollow noreferrer">https://github.com/Chris2301/helm</a></p>

furion2000
<pre><code>dependencies:
  - name: nginx-ingress
    version: 0.15.1
    repository: https://helm.nginx.com/stable
</code></pre>
<p>You have declared that the dependency is called &quot;nginx-ingress&quot;. In order for Helm to pass the chart values to the subchart, you need to put these inside a block named the same as the chart so, in your case, you would have to put your values inside a block named <code>nginx-ingress</code></p>
<p>See <a href="https://stackoverflow.com/questions/73006380/helm-template-is-not-using-values-yaml-file/73006449#73006449">this question</a> where the OP had the same problem.</p>
<hr />
<p><strong>UPDATE AFTER VIEWING CODE</strong></p>
<p>What you have done is correct. The config file does not update because the ingress controller uses your <code>ingress</code> resource to determine how to route your request.</p>
<p>For example:</p>
<pre><code>$ kubectl get ingress ingress-service -o yaml | grep &quot;spec:&quot; -A 18
spec:
  rules:
  - host: project.k8s.com
    http:
      paths:
      - backend:
          service:
            name: project-backend
            port:
              number: 8080
        path: /api/
        pathType: Prefix
      - backend:
          service:
            name: nginx
            port:
              number: 80
        path: /
        pathType: Prefix
</code></pre>
<p>I modified the service linked to the &quot;/&quot; in order to test the functionality.</p>
<p>I installed the bitnami nginx chart to provide a test backend service:</p>
<pre><code>helm install nginx bitnami/nginx
</code></pre>
<p>This created a service called <code>nginx</code> in the default namespace (also where I installed your chart)</p>
<pre><code>$ kubectl get svc 
NAME                    TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)                      AGE
ingress-nginx-ingress   LoadBalancer   10.109.222.226   10.109.222.226   80:30892/TCP,443:30210/TCP   27m
kubernetes              ClusterIP      10.96.0.1        &lt;none&gt;           443/TCP                      38m
nginx                   LoadBalancer   10.97.31.201     10.97.31.201     80:32484/TCP                 25m
</code></pre>
<p>So now I can use the external IP for the loadbalancer created by your chart (<code>ingress-nginx-ingress</code>) and hit that using <code>curl</code>. We have to use <code>Host</code> here so that the ingress controller knows which rule to match.</p>
<pre><code>$ curl 10.109.222.226 -H &quot;Host: project.k8s.com&quot;
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Welcome to nginx!&lt;/title&gt;
&lt;style&gt;
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Welcome to nginx!&lt;/h1&gt;
&lt;p&gt;If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.&lt;/p&gt;

&lt;p&gt;For online documentation and support please refer to
&lt;a href=&quot;http://nginx.org/&quot;&gt;nginx.org&lt;/a&gt;.&lt;br/&gt;
Commercial support is available at
&lt;a href=&quot;http://nginx.com/&quot;&gt;nginx.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for using nginx.&lt;/em&gt;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p>As you can see, the controller returned the nginx content correctly. You can verify this by hitting the nginx service directly also (no need to use the <code>Host</code> header this time)</p>
<pre><code>$ curl 10.97.31.201
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Welcome to nginx!&lt;/title&gt;
&lt;style&gt;
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Welcome to nginx!&lt;/h1&gt;
&lt;p&gt;If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.&lt;/p&gt;

&lt;p&gt;For online documentation and support please refer to
&lt;a href=&quot;http://nginx.org/&quot;&gt;nginx.org&lt;/a&gt;.&lt;br/&gt;
Commercial support is available at
&lt;a href=&quot;http://nginx.com/&quot;&gt;nginx.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for using nginx.&lt;/em&gt;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p>Now if we tried to use the <code>/api/</code> endpoint, it'll fail because the backend service (<code>project-backend</code>) does not exist:</p>
<pre><code>$ curl 10.109.222.226/api/ -H &quot;Host: project.k8s.com&quot;
&lt;html&gt;
&lt;head&gt;&lt;title&gt;502 Bad Gateway&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;
&lt;center&gt;&lt;h1&gt;502 Bad Gateway&lt;/h1&gt;&lt;/center&gt;
&lt;hr&gt;&lt;center&gt;nginx/1.23.2&lt;/center&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p>So to answer your original question, the <code>/api/</code> is not in the nginx config because the controller uses the ingress resource to determine routing.</p>
<p>Your chart is performing as expected.</p>
