<p>I have four kubernetes clusters, and I want to check the expiration time of them with kubernetes-python-client.</p>
<p>I am following this page: <a href="https://github.com/kubernetes-client/python" rel="nofollow noreferrer">https://github.com/kubernetes-client/python</a></p>
<p>Is there anyone know how to get it?</p>

KeithTt
<p>The apiserver certificate is generally handled out of band, either by your Kubernetes installer tool (kubeadm, rancher, talos, etc) or off-cluster in a load balancer layer. As such the K8s API won't help you with this.</p>
<p>That said, you can get the certificate of any HTTPS server in Python using <code>ssl.get_server_certificate()</code> (<a href="https://docs.python.org/3/library/ssl.html#ssl.get_server_certificate" rel="nofollow noreferrer">https://docs.python.org/3/library/ssl.html#ssl.get_server_certificate</a>) along with other functions in the <code>ssl</code> module to parse the cert data and then look at the Not After timestamp.</p>
