-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fresh install giving certificate has expired or is not yet valid error #2112
Comments
Check the system time on both nodes, and the host you copied the kubeconfig file to. I suspect that there is some sort of time skew that has made it so that the cert is either not yet valid, or has already expired, according to the clock on your host that is experiencing the issue. |
date command for both nodes and host gives Wed 12 Aug 2020 10:10:xx AM EDT |
Did you remember to edit the |
Thank you, that works. I had replaced |
Environmental Info:
K3s Version:
k3s version v1.18.6+k3s1 (6f56fa1)
Node(s) CPU architecture, OS, and Version:
Linux rancher-server-0 5.7.11-1-default #1 SMP Wed Jul 29 09:32:21 UTC 2020 (5015994) x86_64 x86_64 x86_64 GNU/Linux
Linux rancher-server-1 5.7.11-1-default #1 SMP Wed Jul 29 09:32:21 UTC 2020 (5015994) x86_64 x86_64 x86_64 GNU/Linux
Cluster Configuration:
Two k3s nodes running on a Ubuntu 20.04 host
Describe the bug:
Fresh k3s install, getting error "Unable to connect to the server: x509: certificate has expired or is not yet valid" when executing command
kubectl --kubeconfig ~/.kube/config/k3s.yaml get pods --all-namespaces
on the host system
Steps To Reproduce:
curl -sfL https://get.k3s.io | sh -s - server \ --datastore-endpoint="mysql://username:password@tcp(hostname:3306)/database-name"
per the instructions herekubectl --kubeconfig ~/.kube/config/k3s.yaml get pods --all-namespaces
on the hostExpected behavior:
Get a valid kubectl response
Actual behavior:
Get an error: "Unable to connect to the server: x509: certificate has expired or is not yet valid"
Additional context / logs:
Running nginx loadbalancer on the host in a container as described here. And executing
k3s kubectl get pods --all-namespaces
on either node gives the correct response so k3s is up and running.The text was updated successfully, but these errors were encountered: