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

织梦网站如何做301跳转软文推广文章范文

织梦网站如何做301跳转,软文推广文章范文,门户网站什么意思举例子,建一个网站花多少钱一、k8s集群证书过期解决 问题现象 K8S集群证书过期后,会导无法创建Pod,通过kubectl get nodes也无法获取信息,甚至dashboard也无法访问。 执行命令发现报错: Unable to connect to the server: x509: certificate has expire…

一、k8s集群证书过期解决

问题现象

K8S集群证书过期后,会导无法创建Pod,通过kubectl get nodes也无法获取信息,甚至dashboard也无法访问。

执行命令发现报错:

Unable to connect to the server: x509: certificate has expired or is not yet valid

查看K8S的日志:

Part of the existing bootstrap client certificate is expired: 2023-08-29 02:29:04 +0000 UT
这是说明k8s使用的证书过期了,k8s自带证书是一年的有效期。所以我们解决问题的办法就是更换证书。

二、确认K8S证书过期时间

2.1 查看k8s某一证书过期时间:
[root@k8s-master-47 ~]# openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text | grep NotNot Before: Aug 29 03:32:16 2021 GMTNot After : Aug 26 03:32:16 2023 GMT
2.2 其它证书同理,K8s各个证书过期时间如下:
/etc/kubernetes/pki/apiserver.crt           #1年有效期
/etc/kubernetes/pki/front-proxy-ca.crt        #10年有效期
/etc/kubernetes/pki/ca.crt              #10年有效期
/etc/kubernetes/pki/apiserver-etcd-client.crt    #1年有效期
/etc/kubernetes/pki/front-proxy-client.crt      #1年有效期
/etc/kubernetes/pki/etcd/server.crt         #1年有效期
/etc/kubernetes/pki/etcd/ca.crt           #10年有效期
/etc/kubernetes/pki/etcd/peer.crt          #1年有效期
/etc/kubernetes/pki/etcd/healthcheck-client.crt  #1年有效期
/etc/kubernetes/pki/apiserver-kubelet-client.crt  #1年有效期
2.3 或使用统一命令查看
[root@k8s-master-47 ~]# kubeadm alpha certs check-expiration

三、使用延长证书过期的方法解决K8S证书过期问题

K8S在过期之前,使用kubeadm alpha phase里的certs和kubeconfig命令,同时配合kubelet证书自动轮换机制来解决这个问题(具体操作可以百度搜索),这里介绍证书已经过期的解决方法,以下延长证书过期的方法适合kubernetes1.14、1.15、1.16、1.17、1.18版本。操作步骤如下:

3.1 下载update-kubeadm-cert.sh

giuhub地址:

  • https://github.com/yuyicai/update-kube-cert

脚本地址:

  • https://github.com/yuyicai/update-kube-cert/blob/master/update-kubeadm-cert.sh

如果你用containerd 作为 CRI runtime

  • 需要下载update-kubeadm-cert-crictl.sh 这个脚本
3.2 把update-kubeadm-cert.sh文件上传到k8s任一master节点任意位置
3.3 在任一master节点执行如下命令
1)脚本添加可执行权限并执行
chmod +x update-kubeadm-cert.sh
./update-kubeadm-cert.sh all
2)验证
[root@k8s-master-47 ~]# openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text  | grep NotNot Before: Aug 29 03:32:16 2023 GMTNot After : Aug 26 03:32:16 2033 GMT[root@k8s-master-47 ~]# kubeadm alpha 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 -oyaml'CERTIFICATE                EXPIRES                  RESIDUAL TIME   CERTIFICATE AUTHORITY   EXTERNALLY MANAGED
admin.conf                 Aug 26, 2033 03:32 UTC   9y                                      no      
apiserver                  Aug 26, 2033 03:32 UTC   9y              ca                      no      
apiserver-etcd-client      Aug 26, 2033 03:32 UTC   9y              etcd-ca                 no      
apiserver-kubelet-client   Aug 26, 2033 03:32 UTC   9y              ca                      no      
controller-manager.conf    Aug 26, 2033 03:32 UTC   9y                                      no      
etcd-healthcheck-client    Aug 26, 2033 03:32 UTC   9y              etcd-ca                 no      
etcd-peer                  Aug 26, 2033 03:32 UTC   9y              etcd-ca                 no      
etcd-server                Aug 26, 2033 03:32 UTC   9y              etcd-ca                 no      
front-proxy-client         Aug 26, 2033 03:32 UTC   9y              front-proxy-ca          no      
scheduler.conf             Aug 26, 2033 03:32 UTC   9y                                      no      CERTIFICATE AUTHORITY   EXPIRES                  RESIDUAL TIME   EXTERNALLY MANAGED
ca                      Aug 24, 2031 11:28 UTC   7y              no      
etcd-ca                 Aug 24, 2031 11:28 UTC   7y              no      
front-proxy-ca          Aug 24, 2031 11:28 UTC   7y              no      
[root@k8s-master-47 ~]# 
3.4 更新证书失败后回滚

The script will back up the /etc/kubernetes directory into /etc/kubernetes.old-$(date +%Y%m%d) (for example: kubernetes.old-20200325)

If the the script is failed to be executed, use the backup directory to overide the /etc/kubernetes directory.

[root@k8s-master-47 ~]# ls /etc/kubernetes.old-20230829
3.5 k8s修改默认命名空间
kubectl config set-context $(kubectl config current-context) --namespace=soms

四、参考:

  • http://www.taodudu.cc/news/show-3680378.html?action=onClick
  • https://github.com/yuyicai/update-kube-cert
http://www.hkea.cn/news/544284/

相关文章:

  • 柬埔寨网站开发营销技巧和营销方法
  • 网站建立价格长沙网站外包公司
  • 王建设医生个人网站免费google账号注册入口
  • 免费自建手机网站搜索引擎优化的方法包括
  • 甘肃省建设工程安全质量监督管理局网站官网拉新项目官方一手平台
  • 做电影网站赚钱武汉新闻最新消息
  • 做网站没有成本的方法上海百度分公司电话
  • 寺庙网站建设百度ai人工智能
  • 完成公司网站建设下载关键词推广软件
  • wordpress如何关闭网站下载app
  • WordPress小程序二次修改石家庄seo排名外包
  • 做百度关键词网站厦门seo外包
  • 泉州seo-泉州网站建设公司谷歌关键词搜索工具
  • 组织部网站建设方案行业关键词分类
  • 上海黄浦 网站制作中国搜索引擎排名2021
  • 手机网站建设 cms营销技巧和营销方法
  • 平顶山做网站优化微博搜索引擎优化
  • 网站如何做品牌宣传海报每日舆情信息报送
  • 做论坛网站需要多大空间seo推广招聘
  • 中国建设银行网站软件不限次数观看视频的app
  • 网站开发建设的步骤win11优化大师
  • 在线做数据图的网站樱桃bt磁力天堂
  • 网站建设费的税率东莞公司网上推广
  • 上海设计公司排名前十宁波seo搜索优化费用
  • 如皋做网站公司com域名
  • 织梦做企业网站教程网络营销推广方案论文
  • 微信如何添加小程序二十条优化措施全文
  • 网站制作费可以做业务宣传费河北百度推广电话
  • wordpress日主题破解网站排名优化软件有哪些
  • 做公众号app 网站 app济南网站设计