-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Certificate gets to invalid and no way to recover if k3s gets started at a future time #6152
Comments
Duplicate of #5163 (comment) You should ensure that time does not go backwards while Kubernetes is running, in particular backwards to before the service was started. |
Thank you for responding. I of course don't want to set the system time backwards. It is because the system time was wrong when And it is no way for me to start |
Right, but as noted in the comments on that other issue, Kubernetes does not handle time going backwards well if at all. Renewal covers extending certificates that have or are about to expire, it does not handle certificates that aren't valid yet because they were issued in the future. If this is a common problem for you, you might consider adding a dependency on your time sync service of choice to the k3s service. |
Ok..., is there any workarounds to make k3s re-generate those invalid certificates? I tried deleting the whole dir Getting it work again is so important and basic, isn't? Like 5163 (comment) mentioned, |
face same issue, set time backwards, and k3s crash with x509 error |
Don't set the system time backwards to before K3s was originally started. Everything, including the cluster CA certificates, will be invalid. This is not something we are planning on supporting. |
Environmental Info:
K3s Version: v1.23.10+k3s1
Linux system: Alpine-3.15.4
Linux kernel: 5.15.55-0-virt
Describe the bug:
Certificate gets to invalid and no way to recover if k3s gets started at a future time. This issue is different from #5163, which is about the certificate is used after the valid time range. My issue is about the certificate is used before the valid time range. They are opposite. The workaround mentioned in #5163 and the fix #5896 don't work for this one.
Steps To Reproduce:
My steps
Unable to connect to the server: x509: certificate has expired or is not yet valid: current time 2022-09-16T18:32:28Z is before 2022-09-16T18:41:21Z
For you, to easily reproduce
date <a future time>
Expected behavior:
Unless I set the system time to the future time again, k3s is not usable any more. Restarting can't fix it. k3s can rotate the expired certs to the future, it also needs to rotate the future certs to now, doesn't it?
The text was updated successfully, but these errors were encountered: