美文网首页kubernetes
934.【kubernetes】kubeadm版本更新证书

934.【kubernetes】kubeadm版本更新证书

作者: 七镜 | 来源:发表于2024-02-05 00:28 被阅读0次

一、问题背景

  1. kubernetes 的安装方式为:kubeadm安装;
  2. 执行 kubectl get po 时遇到的报错如下:
E0205 13:19:46.526842   21513 memcache.go:238] couldn't get current server API group list: Get "https://cloudwave1:6443/api?timeout=32s": x509: certificate has expired or is not yet valid: current time 2024-02-05T13:19:46+08:00 is after 2024-01-20T10:16:49Z
E0205 13:19:46.529545   21513 memcache.go:238] couldn't get current server API group list: Get "https://cloudwave1:6443/api?timeout=32s": x509: certificate has expired or is not yet valid: current time 2024-02-05T13:19:46+08:00 is after 2024-01-20T10:16:49Z
E0205 13:19:46.532281   21513 memcache.go:238] couldn't get current server API group list: Get "https://cloudwave1:6443/api?timeout=32s": x509: certificate has expired or is not yet valid: current time 2024-02-05T13:19:46+08:00 is after 2024-01-20T10:16:49Z
E0205 13:19:46.538640   21513 memcache.go:238] couldn't get current server API group list: Get "https://cloudwave1:6443/api?timeout=32s": x509: certificate has expired or is not yet valid: current time 2024-02-05T13:19:46+08:00 is after 2024-01-20T10:16:49Z
E0205 13:19:46.541266   21513 memcache.go:238] couldn't get current server API group list: Get "https://cloudwave1:6443/api?timeout=32s": x509: certificate has expired or is not yet valid: current time 2024-02-05T13:19:46+08:00 is after 2024-01-20T10:16:49Z
Unable to connect to the server: x509: certificate has expired or is not yet valid: current time 2024-02-05T13:19:46+08:00 is after 2024-01-20T10:16:49Z

显然,证书到期了,没有续;

二、解决办法如下

  1. 执行:kubeadm certs renew all,更新证书

  2. 找到并重启 kube-apiserver 服务

## 查找服务
docker ps | grep kube-api
##
docker restart 容器id
  1. 找到并重启 kube-controller-manager 服务
## 查找服务
docker ps | grep kube-controller
##
docker restart 容器id
  1. 找到并重启 kube-scheduler 服务
## 查找服务
docker ps | grep kube-scheduler
##
docker restart 容器id
  1. 找到并重启 etcd 服务
## 查找服务
docker ps | grep etcd
##
docker restart 容器id

相关文章

网友评论

    本文标题:934.【kubernetes】kubeadm版本更新证书

    本文链接:https://www.haomeiwen.com/subject/hesfadtx.html