kubernetes-vagrant-centos-cluster icon indicating copy to clipboard operation
kubernetes-vagrant-centos-cluster copied to clipboard

the certificate has expired

Open TravisRoad opened this issue 2 years ago • 7 comments

Environment

  • OS: Arch Linux x86_64 6.1.4-arch1-1
  • Kubernetes version: v1.16.14
  • VirtualBox version: v7.0.4
  • Vagrant version: 2.3.4

What I did?

I just follow the readme, and copy the conf/admin.kubeconfig to ~/.kube/config. When I use kubectl get nodes, it shows

Unable to connect to the server: x509: certificate has expired or is not yet valid: 
current time 2023-01-09T22:08:46+08:00 is after 2023-01-09T09:34:00Z

Messages

when installing node3, it also show that the x509 certificate expired.

node3: deploy coredns
node3: unable to recognize "STDIN": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "STDIN": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "STDIN": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "STDIN": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "STDIN": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "STDIN": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: /home/vagrant
node3: deploy kubernetes dashboard
node3: unable to recognize "/vagrant/addon/dashboard/kubernetes-dashboard.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "/vagrant/addon/dashboard/kubernetes-dashboard.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "/vagrant/addon/dashboard/kubernetes-dashboard.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "/vagrant/addon/dashboard/kubernetes-dashboard.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "/vagrant/addon/dashboard/kubernetes-dashboard.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "/vagrant/addon/dashboard/kubernetes-dashboard.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: create admin role token
node3: unable to recognize "/vagrant/yaml/admin-role.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "/vagrant/yaml/admin-role.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: the admin role token is:
node3: Unable to connect to the server: x509: certificate has expired or is not yet valid
node3: Unable to connect to the server: x509: certificate has expired or is not yet valid
node3: login to dashboard with the above token
node3: Unable to connect to the server: x509: certificate has expired or is not yet valid
node3: https://172.17.8.101:
node3: install traefik ingress controller
node3: unable to recognize "/vagrant/addon/traefik-ingress/ingress.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "/vagrant/addon/traefik-ingress/traefik-rbac.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "/vagrant/addon/traefik-ingress/traefik.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "/vagrant/addon/traefik-ingress/traefik.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: unable to recognize "/vagrant/addon/traefik-ingress/traefik.yaml": Get https://172.17.8.101:6443/api?timeout=32s: x509: certificate has expired or is not yet valid
node3: Configure Kubectl to autocomplete

# kubectl get nodes
Unable to connect to the server: x509: certificate has expired or is not yet valid: 
current time 2023-01-09T22:08:46+08:00 is after 2023-01-09T09:34:00Z

I'm a newbie learning the k8s. I find this on stackoverflow, but I cannot find /etc/kubernetes/pki/apiserver.crt. Maybe I should modify the change the conf/admin.kubeconfig? Thanks in advanced.

TravisRoad avatar Jan 09 '23 14:01 TravisRoad

您好,邮件我已收到。

eason-su avatar Jan 09 '23 14:01 eason-su

遇到同样的问题,求助

lucienhsu avatar Feb 18 '23 04:02 lucienhsu

您好,邮件我已收到。

eason-su avatar Feb 18 '23 04:02 eason-su

same problem on Ubuntu 22.04

Ryan-dev-design avatar Apr 07 '23 12:04 Ryan-dev-design

您好,邮件我已收到。

eason-su avatar Apr 07 '23 12:04 eason-su

The same! Someone has the solution?

luis-herrera-aburto avatar May 05 '23 20:05 luis-herrera-aburto

您好,邮件我已收到。

eason-su avatar May 05 '23 20:05 eason-su