How to renew lets encrypt certificate manually using cert manager

how i can renew my lets encrypt certificate for nginx ingress controller using cert manager. I wanted to renew the lets encrypt certificate before renewal time. Looking forward to hear back.

K8s Version: 1:23

The operating system my web server runs on is (include version): ubuntu

The version of my client is: cert manager

Status:
  Conditions:
    Last Transition Time:  2023-05-12T14:10:19Z
    Message:               Certificate is up to date and has not expired
    Observed Generation:   1
    Reason:                Ready
    Status:                True
    Type:                  Ready
  Not After:               2023-08-10T13:10:18Z
  Not Before:              2023-05-12T13:10:19Z
  Renewal Time:            2023-07-11T13:10:18Z
  Revision:                1
Events:                    <none>

here my expiry and renewal time. i wanted to renew it immediately. any speicifc command?

You might want to check this about renewing at will:

6 Likes

Just delete the certificate secret. cert-manager will immediately request a new certificate.

4 Likes

Hi griffin,

This will cause downtime. how i can renew it without downtime.

It will not cause downtime. Certificates are cached in memory by the webserver instances. Once the new certificate secret has been created, the webserver instances will be gracefully reloaded to pickup the new certificate.

6 Likes

Thank you mike,

I hope cmctl command will work to renew it manually.

2 Likes

Thanks griffin,

The secret and certificate i wanted to renew is for nginx ingress controller not for webserver. I have doubt how it will cache. As deleting and creating need downtime and reosurce will not avl for that particular time

1 Like

Where did you learn/read this?

4 Likes

I know it's for an ingress controller. When I said "webserver" I was really meaning nginx instance (or similar). Are you using ingress-nginx via helm?

5 Likes

Not unless you destroy your ingress instances in the process.

4 Likes

Yes, using cert-manager's CL tool will allow you to handle this more explicitly, per @MikeMcQ's good suggestion. I provided the quicker/dirtier approach I've used several times in my day job.

5 Likes

yes. we are using helm for life cycle mgmt

1 Like

tysm @griffin for prompt response. Appreciate your suggestion.

2 Likes

One more query. Does cert manager handle the renewal process of certificate automatically. based on the renewal time?

Not After: 2023-08-10T13:10:18Z

Not Before: 2023-05-12T13:10:19Z

Renewal Time: 2023-07-11T13:10:18Z

Revision: 1

Events:

1 Like

Yes. 30 days (1/3 life remaining) prior

5 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.