-
Notifications
You must be signed in to change notification settings - Fork 1.4k
✨ Automatically renew control plane machine certificates before expiration through machine repave #6983
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
✨ Automatically renew control plane machine certificates before expiration through machine repave #6983
Conversation
bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go
Outdated
Show resolved
Hide resolved
bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go
Outdated
Show resolved
Hide resolved
internal/controllers/machinehealthcheck/machinehealthcheck_targets.go
Outdated
Show resolved
Hide resolved
internal/controllers/machinehealthcheck/machinehealthcheck_targets.go
Outdated
Show resolved
Hide resolved
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.
Very nice.
I think mostly nits from my side
Very nice feature and not a lot of changes necessary to make it happen.
Should we change the PR description to Part of
. Given that the PR implements the feature but doesn't include other stuff like e.g. the column and the documentation?
bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go
Outdated
Show resolved
Hide resolved
bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go
Outdated
Show resolved
Hide resolved
internal/controllers/machinehealthcheck/machinehealthcheck_targets.go
Outdated
Show resolved
Hide resolved
internal/controllers/machinehealthcheck/machinehealthcheck_targets.go
Outdated
Show resolved
Hide resolved
internal/controllers/machinehealthcheck/machinehealthcheck_targets.go
Outdated
Show resolved
Hide resolved
d1f39be
to
3c3fa0c
Compare
3c3fa0c
to
d6f18c4
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.
did a high-level review on the delta between the time of my last review and now.
Should we flag the PR as WIP again for now?
controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_types.go
Outdated
Show resolved
Hide resolved
/retitle ✨ [WIP] Automatically renew control plane machine certificates before expiration through machine repave |
Reviewed the delta, looks good so far. Once we finalized the API and the PR is otherwise ready I would do some in-depth manual testing and another detailed review |
This looks pretty good! Only nits, except (potentially) #6983 (comment) |
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.
only nits
bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go
Outdated
Show resolved
Hide resolved
controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go
Outdated
Show resolved
Hide resolved
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.
2 nits otherwise delta looks perfect
Great work! lgtm pending squash |
2d49b40
to
0a93b4f
Compare
Squashed. |
Thx! /lgtm |
lgtm pending squash |
A new annotation is added to KubeadmConfig that captures the certificate expiry information. This information is propagated to machines. This new information can be used by KCP to perform a rollout if the machine certificates are about to expire. Note: The expiry time captured in KubeadmConfig is an approximate time of when the certificates will expire but it is guaranteed to be before the actual certificate expiry.
954be1f
to
bac8e27
Compare
Squashed. |
great job! this is a long-awaited feature for many CAPI users |
Great work! /approve Would be good to surface this feature somewhere in our book |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@ykakarap do you mind opening an issue for this? |
What this PR does / why we need it:
This PR achieves certificate rotation on control plane machine by repaving the machines.
It is achieved by doing the following:
machine.cluster.x-k8s.io/certificates-expiry-date
) on KubeadmBootstrapConfig objects that captures the certificates expiry date (1 year from the creation time)kcp.spec.rolloutBefore.certificatesExpiryDays
that can be used to trigger a rollout if the control plane machine's certificates will expire within the specified days.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #6529