I'm quite new to Kubernetes. But so far was able to configure an AKS (Azure Kubernetes Services) cluster. I have multiple namespaces for my services (Dev, stage, prod). And configured an Ingress service using nginx (into it's own namespace 'ingress-nginx'). The setup works perfectly with HTTP.
My problems started when I tried to use HTTPS. First installed cert-manager by using this script. It has created it own namespace again: 'cert-manager' I was not using HELM just regular manifest. Also followed MS Azure DNS config.
Everything seems correct I have my services, secrets, clusterIssuer, etc. Even challenge created in Azure DNS Zone. You can see it on Azure portal. But I did not get any certificate.
ClusterIssuer config:
apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
name: 8b3s-org-letsencrypt
spec:
acme:
#server: https://acme-v02.api.letsencrypt.org/directory
server: https://acme-staging-v02.api.letsencrypt.org/directory
email: <[email protected]>
privateKeySecretRef:
name: 8b3s-org-letsencrypt-key
solvers:
- selector:
dns01:
azuredns:
clientID: ....
clientSecretSecretRef:
# The following is the secret we created in Kubernetes. Issuer will use this to present challenge to Azure DNS.
name: azuredns-config
key: client-secret
subscriptionID: ....
tenantID: "...."
resourceGroupName: Web
hostedZoneName: 8b3s.org
# Azure Cloud Environment, default to AzurePublicCloud
environment: AzurePublicCloud
Ingress config:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: 8b3s-virtual-host-ingress
namespace: ingress-nginx
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/rewrite-target: /
cert-manager.io/cluster-issuer: "8b3s-org-letsencrypt"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/tls-acme: "true"
spec:
tls:
- hosts:
- '*.8b3s.org'
secretName: 8b3s-org-letsencrypt-tls
rules:
- host: dev.8b3s.org
http:
paths:
- path: /
backend:
serviceName: the8b3swebsite-development-ext
servicePort: 8080
So the issue is every config seems OK but there is no Cert at all. I got only an 'Opaque' ' tls.key: 1679 bytes' as '8b3s-org-letsencrypt-key' in the 'cert-manager' namespace.
The Cert got created for the 'ingress-nginx' namespaces '8b3s-org-letsencrypt-tls' as type 'kubernetes.io/tls'. But 'ca.crt: 0 bytes' and 'tls.crt: 0 bytes'.
I was also looking into cert-manager pods output. Found those 2 logs weird (if needed I have the full logs):
I0222 22:51:00.067791 1 acme.go:201] cert-manager/controller/certificaterequests-issuer-acme/sign "msg"="acme Order resource is not in a ready state, waiting..." "related_resource_kind"="Order" "related_resource_name"="8b3s-org-letsencrypt-tls-1807766204-3808299645" "related_resource_namespace"="ingress-nginx" "resource_kind"="CertificateRequest" "resource_name"="8b3s-org-letsencrypt-tls-1807766204" "resource_namespace"="ingress-nginx"
I0222 22:51:00.068069 1 sync.go:129] cert-manager/controller/orders "msg"="Creating additional Challenge resources to complete Order" "resource_kind"="Order" "resource_name"="8b3s-org-letsencrypt-tls-1807766204-3808299645" "resource_namespace"="ingress-nginx"
E0222 22:51:01.876182 1 sync.go:184] cert-manager/controller/challenges "msg"="propagation check failed" "error"="DNS record for \"8b3s.org\" not yet propagated" "dnsName"="8b3s.org" "resource_kind"="Challenge" "resource_name"="8b3s-org-letsencrypt-tls-1807766204-3808299645-481622463" "resource_namespace"="ingress-nginx" "type"="dns-01"
Any idea what can be the problem?
UPDATE: Added Azure NS records to my domain DNS as suggested. Waited an hour or so but there is no effect... Deleted existing CA secrets, restarted all Nginx, cert-manager Pods. And noticed the following error:
E0225 10:14:03.671099 1 util.go:71] cert-manager/controller/certificaterequests/handleOwnedResource "msg"="error getting order referenced by resource" "error"="certificaterequest.cert-manager.io \"8b3s-org-letsencrypt-tls-1807766204\" not found" "related_resource_kind"="CertificateRequest" "related_resource_name"="8b3s-org-letsencrypt-tls-1807766204" "related_resource_namespace"="ingress-nginx" "resource_kind"="Order" "resource_name"="8b3s-org-letsencrypt-tls-1807766204-3808299645" "resource_namespace"="ingress-nginx"
E0225 10:14:03.674679 1 util.go:71] cert-manager/controller/certificates/handleOwnedResource "msg"="error getting order referenced by resource" "error"="certificate.cert-manager.io \"8b3s-org-letsencrypt-tls\" not found" "related_resource_kind"="Certificate" "related_resource_name"="8b3s-org-letsencrypt-tls" "related_resource_namespace"="ingress-nginx" "resource_kind"="CertificateRequest" "resource_name"="8b3s-org-letsencrypt-tls-1807766204" "resource_namespace"="ingress-nginx"