<h2>Context</h2>
<p>I have a <strong>k3s</strong> (v1.19.3+k3s3) cluster and I am using the '<em>out of the box</em>' <a href="https://rancher.com/docs/k3s/latest/en/networking/" rel="nofollow noreferrer">traefik ingress controler</a></p>
<pre class="lang-sh prettyprint-override"><code>kubectl  get svc -n kube-system 
NAME                 TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)                      AGE
kube-dns             ClusterIP      10.43.0.10      &lt;none&gt;          53/UDP,53/TCP,9153/TCP       5d16h
metrics-server       ClusterIP      10.43.127.152   &lt;none&gt;          443/TCP                      5d16h
traefik-prometheus   ClusterIP      10.43.73.131    &lt;none&gt;          9100/TCP                     5d16h
traefik              LoadBalancer   10.43.121.125   111.11.11.111   80:32492/TCP,443:31586/TCP   5d16h
</code></pre>
<pre class="lang-sh prettyprint-override"><code>kubectl   -n kube-system describe svc traefik
Name:                     traefik
Namespace:                kube-system
Labels:                   app=traefik
                          app.kubernetes.io/managed-by=Helm
                          chart=traefik-1.81.0
                          heritage=Helm
                          release=traefik
Annotations:              meta.helm.sh/release-name: traefik
                          meta.helm.sh/release-namespace: kube-system
Selector:                 app=traefik,release=traefik
Type:                     LoadBalancer
IP:                       10.43.121.125
LoadBalancer Ingress:     111.11.11.111
Port:                     http  80/TCP
TargetPort:               http/TCP
NodePort:                 http  32492/TCP
Endpoints:                10.42.0.6:80
Port:                     https  443/TCP
TargetPort:               https/TCP
NodePort:                 https  31586/TCP
Endpoints:                10.42.0.6:443
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   &lt;none&gt;

</code></pre>
<h2>The issue</h2>
<p>I do not find how to use this ingress controller using a helm chart (say, this <a href="https://github.com/groundhog2k/helm-charts/tree/master/charts/ghost" rel="nofollow noreferrer">ghost chart</a>). In my  understanding of how Helm charts work and the purpose they fulfill, <code>Ingress</code> templating allow to use different ingress controllers. Here is the chart's <code>ingress.yaml</code></p>
<pre class="lang-yaml prettyprint-override"><code>...
kind: Ingress
metadata:
  name: {{ $fullName }}
  labels:
    {{- include &quot;ghost.labels&quot; . | nindent 4 }}
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: {{ $maxSize }}
  {{- with .Values.ingress.annotations }}
    {{- toYaml . | nindent 4 }}
  {{- end }}
...
</code></pre>
<p>Based on this, I would say that I need to edit the <code>annotations</code> section of <code>values.yaml</code> to <strong>use traefik</strong> instead of default <code>kubernetes.io/ingress.class: nginx</code></p>
<pre class="lang-yaml prettyprint-override"><code>ingress:
  enabled: true
  annotations: 
    kubernetes.io/ingress.class: traefik  # what should I use?
  hosts:
    - host: some.domain.io
      paths:
        - /
  tls:
    - secretName: chart-example-tls
      hosts:
        - some.domain.io
</code></pre>
<p>However, no matter what I try in <code>annotations</code>, <code>helm install</code> keep getting</p>
<pre><code>Error: UPGRADE FAILED: failed to create resource: Internal error occurred: failed calling webhook &quot;validate.nginx.ingress.kubernetes.io&quot;: Post &quot;https://ingress-nginx-controller-admission.ingress-nginx.svc:443/networking/v1beta1/ingresses?timeout=10s&quot;: service &quot;ingress-nginx-controller-admission&quot; not found
</code></pre>
<p>as if helm were looking for an <strong>Nginx ingress controler</strong>, no matter what. Is this a possible limitation of charts (like this one) or am I misconceiving how Helm charts work? How can I use the default <code>traefik ingress</code> on this chart's deployment?</p>

zar3bski
<p>You were correct in your thinking, e.g. in a Helm chart you should be able to define by annotations the ingress correctly.</p>
<p>For example <a href="https://github.com/stefanprodan/podinfo/blob/master/charts/podinfo/templates/ingress.yaml" rel="nofollow noreferrer">https://github.com/stefanprodan/podinfo/blob/master/charts/podinfo/templates/ingress.yaml</a></p>
<p>which defines annotations like:</p>
<pre><code>{{- with .Values.ingress.annotations }}
  annotations:
{{ toYaml . | indent 4 }}
</code></pre>
<p>you could apply traefik specific annotations like</p>
<pre><code>  annotations:
        traefik.ingress.kubernetes.io/router.entrypoints: websecure
        traefik.ingress.kubernetes.io/router.tls.certresolver: myresolver
        traefik.ingress.kubernetes.io/router.middlewares: kube-system-traefik-forward-auth@kubernetescrd
</code></pre>
<p>In the chart from your question:
<a href="https://github.com/groundhog2k/helm-charts/blob/master/charts/ghost/templates/ingress.yaml#L16" rel="nofollow noreferrer">https://github.com/groundhog2k/helm-charts/blob/master/charts/ghost/templates/ingress.yaml#L16</a></p>
<p>the annotation</p>
<pre><code>nginx.ingress.kubernetes.io/proxy-body-size
</code></pre>
<p>is hardcoded. That shouldn't stop the deployment to work properly.
You are stating that it looks as Helm is &quot;looking&quot; for Nginx ingress controller which is not true, afaik. Helm is not looking for anything.
Also apart from that specific reference in annotations, i can't find anything nginx hardcoded, values are commented out.
<a href="https://github.com/groundhog2k/helm-charts/blob/master/charts/ghost/values.yaml#L60" rel="nofollow noreferrer">https://github.com/groundhog2k/helm-charts/blob/master/charts/ghost/values.yaml#L60</a>
So the correct answer is that you still had a faulty nginx ingress deployment.</p>
