<p>I have the following Ingress configuration:</p>
<pre><code>apiVersion: networking.k8s.io/v1        
kind: Ingress
metadata:
  name: http-ingress
spec:
  rules:
  - host: example-adress.com
    http:
      paths:
        - path: /apple
          pathType: Prefix
          backend:
            service:
                name: apple-service
                port: 
                  number: 80
        - path: /banana
          pathType: Prefix
          backend:
            service:
                name: banana-service
                port: 
                  number: 80
  tls: 
    - hosts: 
        - example-adress.com
      secretName: testsecret-tls
</code></pre>
<p>And i also created the Secret:</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: testsecret-tls
  namespace: default
data:
  tls.crt: path to .crt
  tls.key: Zpath to .key
type: kubernetes.io/tls

</code></pre>
<p>But when i connect to one of my services and check the certificate it says that it uses a cert created by Kubernetes Ingress Controller Fake certificate.
When i run microk8s kubectl describe ingress i get the following output:</p>
<pre><code>Name:             http-ingress
Namespace:        default
Address:          127.0.0.1
Default backend:  default-http-backend:80 (&lt;error: endpoints &quot;default-http-backend&quot; not found&gt;)
TLS:
 testsecret-tls terminates example-adress.com
Rules:
 Host               Path  Backends
 ----               ----  --------
 example-adress.com
                    /apple    apple-service:80 (10.1.55.17:5678)
                    /banana   banana-service:80 (10.1.55.10:5678)
Annotations:         &lt;none&gt;
Events:
 Type    Reason  Age                From                      Message
 ----    ------  ----               ----                      -------
 Normal  CREATE  28m                nginx-ingress-controller  Ingress default/http-ingress
 Normal  UPDATE  20m (x2 over 28m)  nginx-ingress-controller  Ingress default/http-ingress
</code></pre>
<p>What do i need to change to make my Ingress use my Cert instead of generating a new one everytime?</p>

timmmmmb
<p>Posting this out of comment as it works.</p>
<p>Based on your tls secret yaml, you tried to add certificate and private key using paths, which is not supported currently (<a href="https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets" rel="nofollow noreferrer">reference</a>)
Fragment from reference:</p>
<blockquote>
<p>When using this type of Secret, the <code>tls.key</code> and the <code>tls.crt</code> key must be provided in the <code>data</code> (or <code>stringData</code>) field of the Secret configuration, although the API server doesn't actually validate the values for each key.</p>
</blockquote>
<p>Therefore there are two suggestions how to move forward:</p>
<ul>
<li>Add base64 encrypted values for key and certificate to tls secret</li>
<li>Allow kubernetes do it for you with the following command:
<code>kubectl create secret tls testsecret-tls --cert=tls.cert --key=tls.key</code></li>
</ul>
