<p>I am working on a DO kubernetes cluster and install ingress nginx and argocd on it, All seems fine and I can easily use the ingress as long as they are accessing the services via http.</p>
<p>I have also installed certmanager and here are the main files regarding my ingress, certificate and issuer:</p>
<p><strong>Ingress</strong></p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: rancher-demo
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
    certmanager.k8s.io/cluster-issuer: &quot;letsencrypt-production&quot;
    nginx.ingress.kubernetes.io/ssl-redirect: &quot;true&quot;
spec:
  tls:
  - hosts:
      - {sub-domain}
    secretName: ssl-cert-production
  rules:
  - host: {sub-domain}
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service: 
            name: rancher-demo
            port:
              number: 80
</code></pre>
<p><strong>Issuer</strong></p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-production
  namespace: default
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    email: {my-email}
    privateKeySecretRef:
      name: letsencrypt-production
    solvers:
    - selector: {}
      http01:
        ingress:
          class: nginx
</code></pre>
<p><strong>Certificate</strong></p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: ssl-cert-production
  namespace: default
spec:
  secretName: ssl-cert-production
  issuerRef:
    name: letsencrypt-production
    kind: ClusterIssuer
  commonName: {sub-domain}
  dnsNames:
  - {sub-domain}
</code></pre>
<p>I went through some other samples on github and questions on stackoverflow and unfortunetly I can not figure out where I am doing it wrong.</p>
<p>Thank you in advance for your attentions</p>

Mehdi Amenein
<p>I finally managed to fix the issue, what I have done was as follow:</p>
<ol>
<li>creating a new kubernete instance</li>
<li>installing cert-manager manaully</li>
<li>installing ingress-nginx manaully</li>
<li>creating the issuer (waiting for it to complete)</li>
<li>creating deployment and cluster</li>
<li>creating ingress config for my application</li>
<li>creating the certificate (waiting for it to complete)</li>
</ol>
<p>I was working on ArgoCD and had to first do these setups myself before handling CD with Argo. It was my own fault that I did not properly go through their documentations. The order is important, but the way I sat up Argo, it was provisioing everything in parallel so for example certificate was being provision before ingress be up or issuer be in place</p>
<p><strong>Also for anyone who is interested in a detailed version please checkout the github repo I created below:</strong></p>
<p><a href="https://github.com/mehdiamenein/cert-manager-nginx-ingress-do" rel="nofollow noreferrer">https://github.com/mehdiamenein/cert-manager-nginx-ingress-do</a></p>
<p>I hope this can be helpful to someone else as well :)</p>
<p>Huge thanks to marcel.dempers for his wonderful video <a href="https://www.youtube.com/watch?v=hoLUigg4V18" rel="nofollow noreferrer">https://www.youtube.com/watch?v=hoLUigg4V18</a></p>
<p>and many thanks to @justin and @harsh-manvar for their comments</p>
