Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7599401
  • 博文数量: 1768
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16342
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1768)

文章存档

2024年(14)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: 系统运维

2023-11-01 17:00:22

很久没用的K8S集群,API一直在重启中
#查看API的报错如下
docker ps -a|grep api 
#查看日志
docker logs 3a921816f730
W1030 07:47:53.595614       1 clientconn.go:1331] [core] grpc: addrConn.createTransport failed to connect to {127.0.0.1:2379 127.0.0.1 0 }. Err: connection error: desc = "transport: authentication handshake failed: x509: certificate has expired or is not yet valid: current time 2023-10-30T07:47:53Z is after 2023-03-11T08:48:10Z". Reconnecting...
#检测是否过期
kubeadm 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'
[check-expiration] Error reading configuration from the Cluster. Falling back to default configuration

CERTIFICATE                EXPIRES                  RESIDUAL TIME   CERTIFICATE AUTHORITY   EXTERNALLY MANAGED
admin.conf                 Mar 11, 2023 08:48 UTC                                  no      
apiserver                  Mar 11, 2023 08:48 UTC          ca                      no      
apiserver-etcd-client      Mar 11, 2023 08:48 UTC          etcd-ca                 no      
apiserver-kubelet-client   Mar 11, 2023 08:48 UTC          ca                      no      
controller-manager.conf    Mar 11, 2023 08:48 UTC                                  no      
etcd-healthcheck-client    Mar 11, 2023 08:48 UTC          etcd-ca                 no      
etcd-peer                  Mar 11, 2023 08:48 UTC          etcd-ca                 no      
etcd-server                Mar 11, 2023 08:48 UTC          etcd-ca                 no      
front-proxy-client         Mar 11, 2023 08:48 UTC          front-proxy-ca          no      
scheduler.conf             Mar 11, 2023 08:48 UTC                                  no      

CERTIFICATE AUTHORITY   EXPIRES                  RESIDUAL TIME   EXTERNALLY MANAGED
ca                      Mar 08, 2032 08:48 UTC   8y              no      
etcd-ca                 Mar 08, 2032 08:48 UTC   8y              no      
front-proxy-ca          Mar 08, 2032 08:48 UTC   8y              no    
#重启生成证书
kubeadm certs renew all
[renew] Reading configuration from the cluster...
[renew] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[renew] Error reading configuration from the Cluster. Falling back to default configuration

certificate embedded in the kubeconfig file for the admin to use and for kubeadm itself renewed
certificate for serving the Kubernetes API renewed
certificate the apiserver uses to access etcd renewed
certificate for the API server to connect to kubelet renewed
certificate embedded in the kubeconfig file for the controller manager to use renewed
certificate for liveness probes to healthcheck etcd renewed
certificate for etcd nodes to communicate with each other renewed
certificate for serving etcd renewed
certificate for the front proxy client renewed
certificate embedded in the kubeconfig file for the scheduler manager to use renewed
Done renewing certificates. You must restart the kube-apiserver, kube-controller-manager, kube-scheduler and etcd, so that they can use the new certificates.

#重新配置config
cp /etc/kubernetes/admin.conf ~/.kube/config

#重启服务就可以正常使用了
kubectl -n kube-system delete pod -l 'component=kube-apiserver'
kubectl -n kube-system delete pod -l 'component=kube-controller-manager'
kubectl -n kube-system delete pod -l 'component=kube-scheduler'
kubectl -n kube-system delete pod -l 'component=etcd'

阅读(334) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~