k8s Client certificate is about to expire 客户端访问 APIServer 证书快过期

博客讲述了作者遇到k8s客户端访问APIServer证书即将过期的报警,通过排查prometheus规则、kubeadm certs检查、Secrets及节点kubectl证书,最终发现是本地证书未更新导致的问题。解决方案包括更新本地证书和考虑使用抓包工具监控客户端证书时间。
摘要由CSDN通过智能技术生成

prometheus rule  

客户端访问 APIServer 证书快过期问题 

KubeClientCertificateExpiration (1 active)
name: KubeClientCertificateExpiration
expr: apiserver_client_certificate_expiration_seconds_count{job="apiserver"} > 0 and on(job) histogram_quantile(0.01, sum by(job, le) (rate(apiserver_client_certificate_expiration_seconds_bucket{job="apiserver"}[5m]))) < 604800
labels:
severity: warning
annotations:
description: A client certificate used to authenticate to the apiserver is expiring in less than 7.0 days.
runbook_url: https://runbooks.prometheus-operator.dev/runbooks/kubernetes/kubeclientcertificateexpiration
summary: Client certificate is about to expire.

今天突然报警k8s 证书剩余时间少于7天 明明前几天刚更新了证书呢 

使用kubeadm certs check-expiration  查看所有证书发现全部都有1年+时间 

 查看prometheus 结果很明显了  就是定位不出那个证书过期了 

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值