rootsongjc / kubernetes-vagrant-centos-cluster

Setting up a distributed Kubernetes cluster along with Istio service mesh locally with Vagrant and VirtualBox, only PoC or Demo use.
https://jimmysong.io
Apache License 2.0
1.93k stars 594 forks source link

the certificate has expired #112

Open TravisRoad opened 1 year ago

TravisRoad commented 1 year ago

Environment

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.

eason-su commented 1 year ago

您好,邮件我已收到。

lucienhsu commented 1 year ago

遇到同样的问题,求助

eason-su commented 1 year ago

您好,邮件我已收到。

Ryan-dev-design commented 1 year ago

same problem on Ubuntu 22.04

eason-su commented 1 year ago

您好,邮件我已收到。

luis-herrera-aburto commented 1 year ago

The same! Someone has the solution?

eason-su commented 1 year ago

您好,邮件我已收到。