-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix certificate refresh and add e2e tests #766
Conversation
We're adding an integration test that refreshes the certificates for control plane nodes as well as worker nodes. It then verifies that the new certificates have the requested expiry date and additional Subject Alternative Names. For simplicity, we'll configure the cluster to automatically approve CSR requests. While at it, we're adding E231 and E226 to the flake8 ignore list since the linter cannot properly handle format strings.
The cluster can be configured to automatically approve certificate sign requests that are issued when refeshing cluster certificates. However, k8sd rejects the CSR requests since it expects them to include a signature that is currently missing. We'll address the problem by adding the missing CSR signature. Note that the CSR signature is passed through k8s annotations and thus needs to be base64 encoded. We're updating the unit tests accordingly.
2cae419
to
b3dd7ca
Compare
The ubuntu 20.04 job fails as the test is unable to retrieve the certificate file:
It fails consistently on 20.04, is the It's either that or the LE: looks like with the |
The k8s cert dir may be either /etc/kubernetes/pki or /var/snap/k8s/etc/kubernetes/pki. We'll need to update our integration test to check both locations.
The requested expiry date and extra SANs are currently ignored when refreshing worker node certificates. There's a TODO and a hard-coded 10y expiry date. This commit ensures that the specified expiry date and Subject Alternative Name are properly passed and applied.
54fdc24
to
0630357
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There are few issues that affect the
k8s refresh-certs
command:This PR addresses these issues and adds an e2e test that refreshes control-plane and worker node certificates, validating the resulting certificates.