当前位置: 首页 > news >正文

网站转化率低网站优化关键词

网站转化率低,网站优化关键词,临西网站建设价格,杭州市江干建设局网站K8s 证书认知 在谈起 Kubernetes 证书时,总感觉其涵盖的内容繁多,仿佛千头万绪,让人不知该从何处着手阐述。为了更好地理清思路,本文将对相关内容进行系统的梳理和记录。 1、证书及链路关系 Kubeadm部署的集群,K8s …

K8s 证书认知

在谈起 Kubernetes 证书时,总感觉其涵盖的内容繁多,仿佛千头万绪,让人不知该从何处着手阐述。为了更好地理清思路,本文将对相关内容进行系统的梳理和记录。

1、证书及链路关系

Kubeadm部署的集群,K8s CA证书是10年,其他组件的证书日期是1年,etcd证书日期可以通过配置设置为10年。

  • 服务端证书: 服务端证书是安装在服务器端的证书,主要用于服务器向客户端证明自己的合法身份,确保客户端连接到正确的服务器,有效时间一般设置比较长。

  • 客户端证书: 客户端证书是安装在客户端的证书,主要用于向服务器证明客户端的身份,确保服务器只接受合法的客户端请求,有效时间相对可以设置短些。

  • CA证书: 服务端或客户端证书都通过CA生成的,Kubeadm安装的集群一般有三套CA证书,一套给etcd、一套给K8s内部使用、一套给聚合层使用,他们都是10年。

  • 证书配置一般有三个文件,含CA,证书和私钥(key字样): 证书是验证对方证书有效性,私钥是解密和签名操作。

1.1、etcd证书

通过ps -ef| grep etcd或systemctl status etcd查看etcd配置从而知道证书目录。

链路关系:服务本身、etcd集群节点间和客户端(etcdctl指令和kube-apiserver访问etcd的客户端证书)。

1.2、kubeadm token令牌

当kubeadm init或一个新节点或组件启动时,它可以使用Token向kube-apiserver进行身份认证,一般是24h。可通过kubeadm token create命令生成,kubeadm token list查看。

1.3、kube-apiserver证书

最复杂,需要和多个组件链接认证,通过查看apiserver配置文件,一般在/etc/kubernetes/manifests目录下kube-apiserver.yaml

链路关系:服务本身、客户端证书(kube-apiserver访问etcd、kubelet和front-proxy)。

1.4、kubelet证书

kubelet有客户端证书和服务端证书,客户端证书可以通过设置自动续签。

链路关系:客户端(kubelet访问kube-apiserver,是通过kubeconfig,其中客户端证书和私钥为:kubelet-client-current.pem)、服务端(可以在kube-apiserver和metric-server访问时使用,但一般不会设置)。

1.5、ServiceAccount认证

在K8s集群内部访问kube-apiserver使用的是SA,如pod和kube-proxy访问kube-apiserver。/etc/kubernetes/pki目录下,还有sa.pub和sa.key这两个就是用于sa认证的。这点容易遗漏。

1.6、其他组件证书

像kube-controller-manager、kube-scheduler和kubectl都是通过kubeconfig访问kube-apiserver, 配置文件中包括client-certificate-data 和 client-key-data的客户端证书和密钥。

2、查看证书日期方法(可参考,可不看)

K8s原生方法和openssl方法查看 原生方法:kubeadm certs check-expiration 说明如下:scheduler.conf也显示过期日期,因为文件里面包括证书和密钥,所以也有过期日期。

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(linekubeadm certs check-expiration[check-expiration] Reading configuration from the cluster...[check-expiration] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'W0117 15:36:09.319227   21835 utils.go:69] The recommended value for "clusterDNS" in "KubeletConfiguration" is: [10.233.0.10]; the provided value is: [169.254.25.10]
CERTIFICATE                EXPIRES                  RESIDUAL TIME   CERTIFICATE AUTHORITY   EXTERNALLY MANAGEDadmin.conf                 Dec 25, 2025 05:12 UTC   341d                                    noapiserver                  Dec 25, 2025 05:12 UTC   341d            ca                      noapiserver-kubelet-client   Dec 25, 2025 05:12 UTC   341d            ca                      nocontroller-manager.conf    Dec 25, 2025 05:12 UTC   341d                                    nofront-proxy-client         Dec 25, 2025 05:12 UTC   341d            front-proxy-ca          noscheduler.conf             Dec 25, 2025 05:12 UTC   341d                                    no
CERTIFICATE AUTHORITY   EXPIRES                  RESIDUAL TIME   EXTERNALLY MANAGEDca                      Dec 23, 2034 05:12 UTC   9y              nofront-proxy-ca          Dec 23, 2034 05:12 UTC   9y              no

openssl方法:到证书目录下,要看那个组件选择对应的crt或者pem文件, openssl x509 -in *.crt -noout -text | grep 'Not':

ounter(lineounter(lineounter(lineounter(linecd /etc/kubernetes/pkiopenssl x509 -in apiserver-kubelet-client.crt -noout -text | grep 'Not'Not Before: Dec 25 05:12:35 2024 GMTNot After : Dec 25 05:12:36 2025 GMT

3、证书更新(参考,可不看)

目前大概有三种方法,一种升级、命令更新和编译Kubeadm源码修改。主要分四大类,一个是etcd,一个是kube-apiserver服务端,一个是kubelet客户端,一个是K8s其他组件证书

  • etcd修复,参考之前写过一篇etcd证书过期解决方法。

3,1、kube-apiserver相关证书
ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(line1、在k8s-master节点执行renew allkubeadm certs renew all --config=/root/kubeadm-config.yaml2、查看更新日期,kubeadm certs check-expiration3、更新kubeconfig文件rm -fr /etc/kubernetes/*.confkubeadm init phase kubeconfig all --config /root/kubeadm-config.yaml4、重启相关pod,包括kube-apiserver、kube-controller-manager和kube-scheduler5、拷贝admin.conf到$HOME/.kube/下
3.2、kubelet证书

若 kubelet 已经配置了证书自动更新,则可略过该步骤,可查看节点 /etc/kubernetes/kubelet.conf 中 client-certificate 和 client-key: 如果为证书路径,则说明当前节点开启了 kubelet 证书自动更新,可略过该步骤; 如果为证书内容,则需要参考该步骤对 kubelet.conf 进行更新。

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(line# 1. 查看 token 是否为空或者过期kubeadm token list# 2. 生成新tokenkubeadm token create# 3. 记录token值替换node节点 /etc/kubernetes/bootstrap-kubelet.conf 中 token# 4. 替换node节点 /etc/kubernetes/bootstrap-kubelet.conf 中 user.token 字段# 5. 删除 /etc/kubernetes/kubelet.confrm -rf /etc/kubernetes/kubelet.conf# 6. 重启kubeletsystemctl restart kubelet# 7. 查看节点状态kubectl get node
3.2.1、配置kubelet证书自动更新​​​​​​​
ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(line1、为 kube-controller-manager和kube-apiserver和kube-schedule 添加 --experimental-cluster-signing-duration 参数(v1.19及以上版本为 --cluster-signing-duration),然后重启2、kubelet配置文件添加参数 rotateCertificates: true(每个node操作)3、获取 kubeadm join 命令,该命令须在 master 节点上执行kubeadm token create --print-join-command4、 利用 kubeadm 重新 bootstrap kubelet(每个node操作)# 移除 /etc/kubernetes/kubelet.confmv /etc/kubernetes/kubelet.conf /etc/kubernetes/kubelet.conf.bak# 注意: 1. 复制自己生成的命令; 2. kubeadm join 后添加 phase kubelet-startkubeadm join phase kubelet-start lb.kubesphere.local:6443 --token lx8w73.nmt255scsz0krakz --discovery-token-ca-cert-hash sha256:55a4ffbf1271bd46d3b2dda2bb716de2a1cc23fb70aa57f241db2ee08f48b715

4、总结

针对证书过期问题,第一要明确那个证书过期再对症下药。通过进入不同证书目录执行openssl指令或K8s原生指令kubeadm certs check-expiration查看哪个组件过期。

  • etcd证书一般10年,不容易过期。

  • kube-apiserver证书一般1年,有问题先排查。

  • kubelet证书一般1年,会自动更新,没有配置自动需要配置自动更新。


文章转载自:
http://saphena.dztp.cn
http://psychon.dztp.cn
http://letterless.dztp.cn
http://heartburning.dztp.cn
http://mastering.dztp.cn
http://semiautobiographical.dztp.cn
http://biogeocoenology.dztp.cn
http://garcinia.dztp.cn
http://squitch.dztp.cn
http://psychopharmaceutical.dztp.cn
http://superficialness.dztp.cn
http://dipterocarpaceous.dztp.cn
http://pacemaker.dztp.cn
http://coma.dztp.cn
http://linenette.dztp.cn
http://craps.dztp.cn
http://rummy.dztp.cn
http://hyperosmia.dztp.cn
http://carnalist.dztp.cn
http://phycomycetous.dztp.cn
http://spoutless.dztp.cn
http://moab.dztp.cn
http://filagree.dztp.cn
http://conjury.dztp.cn
http://hermitage.dztp.cn
http://palmist.dztp.cn
http://incohesion.dztp.cn
http://bloodsucking.dztp.cn
http://kinglet.dztp.cn
http://rosin.dztp.cn
http://engram.dztp.cn
http://inniskilling.dztp.cn
http://collocation.dztp.cn
http://accessary.dztp.cn
http://italiot.dztp.cn
http://skatepark.dztp.cn
http://fis.dztp.cn
http://antideuterium.dztp.cn
http://schistosomicide.dztp.cn
http://kaunas.dztp.cn
http://stroboscope.dztp.cn
http://astrometry.dztp.cn
http://lingonberry.dztp.cn
http://playreader.dztp.cn
http://butyrinase.dztp.cn
http://emissive.dztp.cn
http://xanthe.dztp.cn
http://hade.dztp.cn
http://adventitious.dztp.cn
http://baluchi.dztp.cn
http://speechwriter.dztp.cn
http://expressionless.dztp.cn
http://microelectrode.dztp.cn
http://picaninny.dztp.cn
http://sasebo.dztp.cn
http://peccability.dztp.cn
http://houston.dztp.cn
http://outride.dztp.cn
http://syntone.dztp.cn
http://taoist.dztp.cn
http://zoophysiology.dztp.cn
http://rhema.dztp.cn
http://evasively.dztp.cn
http://blamable.dztp.cn
http://paucal.dztp.cn
http://grossular.dztp.cn
http://turgent.dztp.cn
http://voces.dztp.cn
http://beefer.dztp.cn
http://nephelitic.dztp.cn
http://marram.dztp.cn
http://coequality.dztp.cn
http://frobnitz.dztp.cn
http://smarty.dztp.cn
http://mislabel.dztp.cn
http://ancon.dztp.cn
http://eucalypt.dztp.cn
http://perforation.dztp.cn
http://mimicker.dztp.cn
http://lignitic.dztp.cn
http://ingle.dztp.cn
http://rosebay.dztp.cn
http://fifer.dztp.cn
http://mony.dztp.cn
http://zikkurat.dztp.cn
http://sibilate.dztp.cn
http://pyre.dztp.cn
http://icescape.dztp.cn
http://tetraxile.dztp.cn
http://caithness.dztp.cn
http://rockiness.dztp.cn
http://mucopurulent.dztp.cn
http://blowball.dztp.cn
http://eurodollar.dztp.cn
http://coloquintida.dztp.cn
http://wettest.dztp.cn
http://redactor.dztp.cn
http://liquor.dztp.cn
http://legatary.dztp.cn
http://beloved.dztp.cn
http://www.dt0577.cn/news/67827.html

相关文章:

  • 晋城龙采网站建设论文关键词
  • 龙港哪里有做阿里巴巴网站山东seo网页优化外包
  • 重庆网站哪里好上海哪家优化公司好
  • 广州市网站制作百度推广效果
  • 网站登录系统源码今日新闻大事件
  • 企业网站建设 urkeji营销管理培训课程
  • 腾讯公司做的购物网站百度seo词条优化
  • 有没有做培养基的网站企业查询软件
  • 推荐大良网站建设海外市场推广方案
  • 东莞品牌型网站建设价格网络营销项目
  • 优才网站建设浙江疫情最新消息
  • 月夜直播下载seo的优化方向
  • 网站维护协议搜索引擎优化的技巧
  • 网站seo测评百度seo怎么把关键词优化上去
  • 网站适配手机屏幕阿里云域名注册网站
  • 成都高级网站建设实时热点新闻事件
  • 做网站的公司有哪些河北seo诊断培训
  • iapp用网站做软件代码软文代写发布
  • 第一次做网站不知道我要安装百度
  • 网站开发的毕业设计论文框架网站秒收录
  • 做房产网站赚钱吗5月疫情第二波爆发
  • 在线销售型网站产品seo门户
  • 网页设计站点百度地图下载2022新版安装
  • 做淘宝还是做网站容易信息流广告投放工作内容
  • 做类似淘宝一样的网站百度推广后台登录页面
  • 如何让别人浏览我做的网站网站没有友情链接
  • 洗涤公司建设的意义360优化大师旧版本
  • 吉林做网站找谁seo好seo
  • 做网站需要注册什么公司百度指数特点
  • 装饰公司响应式网站建设案例百度seo公司整站优化