Copied from the official cert-manage installation instructions.
The cert-manager uses the HTTPS-01 self-check like so:
curl http://www.development.openq.dev/.well-known/acme-challenge/sP_ooP5vpdDcz53ExuLTaWxysPYCSEZmuXtXh_3l5fI
"Intracluster calls" are treated differently by Digital Ocean, so some additional annotations must be added to the NGINX Ingress Deployment.
kubectl config set-context --current --namespace ingress-nginx
kubectl edit deploy ingress-nginx-controller
Add the following annotations:
service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: "true"
service.beta.kubernetes.io/do-loadbalancer-hostname: openq.dev
In the end, the ingress-nginx-controller
yaml should look like:
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
meta.helm.sh/release-name: ingress-nginx
meta.helm.sh/release-namespace: ingress-nginx
service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: "true"
service.beta.kubernetes.io/do-loadbalancer-hostname: openq.dev
...
kubectl get pods
kubectl delete pod <POD NAME>
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.8.0/cert-manager.crds.yaml
helm install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--version v1.8.0
kubectl apply -f cluster-issuer.yml
You can start off with using the ACME v2.0 Staging Environment: https://letsencrypt.org/docs/staging-environment/
Then graduate to production once you've confirmed everything works as expected: https://acme-v02.api.letsencrypt.org/directory
On all Ingress
resources, include the following annotation to have SSL certs automatically provisioned:
cert-manager.io/cluster-issuer: openq-cluster-issuer
kubectl get Issuers,ClusterIssuers,Certificates,CertificateRequests,Orders,Challenges --all-namespaces
helm uninstall cert-manager -n cert-manager
kubectl delete Issuers,ClusterIssuers,Certificates,CertificateRequests,Orders,Challenges --all-namespaces --all
kubectl delete -f https://github.com/jetstack/cert-manager/releases/download/v1.8.0/cert-manager.crds.yaml
kubectl delete ns cert-manager