Check certificate experation date

10/23/2019

I need via API to monitor if certificate is invalid and I found this

https://github.com/kubernetes/client-go/blob/611184f7c43ae2d520727f01d49620c7ed33412d/util/certificate/certificate_manager_test.go#L176

But not sure how to use it as it’s too complicated, I just need init a api call like get etc and get the time which the cert should be expired.

Any idea ?

any example will be much appreciated

-- Jon lib
certificate
go
kubernetes

1 Answer

10/23/2019

I would recommend to expose the cert expiration date or days until expiration as a metric. It is common to have a service e.g. Prometheus to scrape metrics from all apps and you can visualize or setup alerts when a certificate is about to expire.

-- Jonas
Source: StackOverflow