title: How to use a wildcard certificate with ingress-nginx installed with Helm?
body: <p>How to use a custom wildcard TLS certificate for all hosts in a <strong>ingress-nginx</strong>?</p>
  <p>I use an <strong>ingress-nginx</strong> as a ingress controller. It is installed using Helm chart:</p>
  <pre class="lang-sh prettyprint-override"><code>helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
  helm repo update
  
  # create secret
  kubectl create secret tls example-com-certificate --namespace ingress-nginx \
      --key certs/tls.key \
      --cert certs/tls.crt   
     
  # install ingress-nginx and use the secret
  helm install ingress-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx \
    --set controller.wildcardTLS.cert=ingress-nginx/example-com-certificate \
    --set controller.service.loadBalancerIP=10.0.0.1
  </code></pre>
  <p>And here the ingress resource example</p>
  <pre class="lang-yaml prettyprint-override"><code>kind: Ingress
  apiVersion: networking.k8s.io/v1beta1
  metadata:
    name: myservice-ingress
    namespace: myservice
    annotations:
      kubernetes.io/ingress.class: &quot;nginx&quot;
      kubernetes.io/ingress.allow-http: &quot;false&quot;    
      nginx.ingress.kubernetes.io/backend-protocol: &quot;http&quot;
      nginx.ingress.kubernetes.io/default-backend: myservice
  spec:  
    tls:  
    - hosts:
      - myservice.example.com
      #secretName omitted to use default wildcard certificate
    rules:
    - host: myservice.example.com
      http:
        paths:
        - path: /
          backend:
            serviceName: myservice
            servicePort: 80
  </code></pre>
  <p>It is expected that when accessing <code>https://myservice.example.com</code> my <code>example-com-certificate</code> is used.</p>
  <p>However a <code>Kubernetes Ingress Controller Fake Certificate</code> is used instead.
  Why?</p>