I found out my certificate is expired this morning and it’s not renewed automatically. Here’s how I debug it step by step.
Get certificate status
| $ kubectl describe cert -n slack slack-tls | 
Try to force certificate renewal
By adding spec.renewBefore to certificate.
| kubectl -n <namespace> patch certificate example-certificate --type=merge -p '{"spec":{"renewBefore":"2159h00m00s"}}' | 
And the order is still invalid.
| $ kubectl -n slack get order | 
So, I try to see if any event happened.
| $ kubectl get event -n slack | 
So, I’m digging out it’s the reason like I posted at: Cert-Manager Error presenting challenge: GoogleCloud API call failed: googleapi: Error 403: Request had insufficient authentication scopes.
We have two node pool on the GKE cluster. unfortunately, cert-manager pod located on a node without www.googleapis.com/cloud-platform permission. So we can add this to make sure it deploy to the right nodes.
| apiVersion: apps/v1 | 
Then, yes it is. Cert-manager start to work.
| $ kubectl describe cert -n slack slack-tls | 
Remember to remove spec.renewBefore, or you will hit Let’s encrypt rate limit.
| kubectl -n <namespace> patch certificate example-certificate --type=json -p='[{"op": "remove", "path": "/spec/renewBefore"}]' | 
After
We might need something like https://www.elastic.co/guide/en/uptime/current/uptime-certificates.html to watch certificates and alert.