Cert Manager not working

Hi,

I am trying to integrate ISTIO with cert manager following the docs here:

But I got the error saying:

Waiting for HTTP-01 challenge propagation:
failed to perform self check GET request 'http://<domain>/.well-known/acme-challenge/rhLUqegNfgpWkwIlKDUTunTbD_DTwrH4oRvtHKkNJZs': 
Get "http://<domain>/.well-known/acme-challenge/rhLUqegNfgpWkwIlKDUTunTbD_DTwrH4oRvtHKkNJZs":
dial tcp <IP>:80: connect: connection refused

Cert manager version: V1.1.0

kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.1.0/cert-manager.yaml

I also created an A record with IP address of ISTIO ingress on GKE for my domain on DNS server.

And here is the config I used:

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-staging
  namespace: istio-system
spec:
  acme:
    # Let's Encrypt uses this to contact you about expiring
    # certificates, and issues related to your account.
    email: <email>
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    privateKeySecretRef:
      name: letsencrypt-staging
    solvers:
    - http01:
        ingress:
          class: nginx

---

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: ingressgateway-certs
  namespace: istio-system
spec:
  secretName: ingressgateway-certs
  commonName: <domain>
  issuerRef:
    name: letsencrypt-staging
    kind: ClusterIssuer
  # Note: need to setup DNS associating below domains with IP of the secret pod
  dnsNames:
  - <domain>

---

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: ingress-gateway
spec:
  selector:
    istio: ingressgateway # use Istio default gateway implementation
  servers:
  - port:
      number: 443
      name: https
      protocol: HTTPS
    tls:
      mode: SIMPLE
      credentialName: ingressgateway-certs
    hosts:
    - <domain>

Thanks

Can you reach the endpoint from within the cluster?

I found the same issue here: https://github.com/jetstack/cert-manager/issues/656

Maybe following the steps there can resolve the issue.

Thanks. I cannot hit the endpoint from inside / outside of cluster.

    solvers:
    - http01:
        ingress:
          class: nginx

means it will be handled by nginx. You want to replace it with class: istio most likely

1 Like

That’s exactly where the problem is. Thank you so much.

Alternatively if it uses nginx class, I realized that its required to configure the routes in virtualservice for the /.well-known/acme-challenge path and acme-solver destination service, and enable port 80 of ingress gateway.