Skip to content
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

🐛 Allow machine rollout if cert reconcile fails #8711

Merged

Conversation

killianmuldoon
Copy link
Contributor

@killianmuldoon killianmuldoon commented May 22, 2023

This fixes the bug described in ##8691 where KCP would fail to re-reconcile to a good state when the kube-apiserver was misconfigured and failing.

Fixes #8691

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 22, 2023
@killianmuldoon
Copy link
Contributor Author

/cherry-pick release-1.4

@k8s-infra-cherrypick-robot

@killianmuldoon: once the present PR merges, I will cherry-pick it on top of release-1.4 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.4

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Contributor Author

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cherry-pick release-1.3

@killianmuldoon
Copy link
Contributor Author

/retest

Copy link
Contributor Author

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/area provider/control-plane-kubeadm

@k8s-ci-robot k8s-ci-robot added the area/provider/control-plane-kubeadm Issues or PRs related to KCP label May 22, 2023
@killianmuldoon
Copy link
Contributor Author

/cherry-pick release-1.3

@k8s-infra-cherrypick-robot

@killianmuldoon: once the present PR merges, I will cherry-pick it on top of release-1.3 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@killianmuldoon
Copy link
Contributor Author

/retest

@@ -445,6 +440,12 @@ func (r *KubeadmControlPlaneReconciler) reconcile(ctx context.Context, cluster *
return ctrl.Result{}, errors.Wrap(err, "failed to update CoreDNS deployment")
}

// Reconcile certificate expiry for machines that don't have the expiry annotation on KubeadmConfig yet.
// Note: This should be at the end of the reconcile so it doesn't block remediation if some machines are unhealthy. Ref:https://github.com/kubernetes-sigs/cluster-api/issues/8691
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok in moving this check here, but remediation was already handled before L374 (where this check was previously located. Probably, it was simply not triggered by MHC.

With this change, we are allowing rollout to happen if a KCP machine is not reporting the certificate expiry, which is good, but unrelated to remediation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue with this check is that it blocked additional rollouts - not MHC remediation. In this case changing KCP to an invalid config caused a new non-working machine to be rolled out. Changing it back to a valid config resulted didn't fix KCP as this function returned an error.

Moving this check down here means that KCP is now able to do the additional rollouts and fix the control plane without MachineHealthChecks.

Copy link
Member

@sbueringer sbueringer May 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can add another point to say we're moving it at the end of the reconcile so it doesn't block anything else as it's not important to run this func before anything else in the reconcile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbueringer could you suggest wording for this comment - I'm not clear on what you're looking for.

Copy link
Member

@sbueringer sbueringer May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I would suggest:

	// Reconcile certificate expiry for Machines that don't have the expiry annotation on KubeadmConfig yet.
	// Note: This requires that all control plane machines are working. We moved this to the end of the reconcile
	// as nothing in the same reconcile depends on it and to ensure it doesn't block anything else, 
	// especially MHC remediation and rollout of changes to recover the control plane.

Hope that makes sense

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Signed-off-by: killianmuldoon <kmuldoon@vmware.com>
@sbueringer
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 23, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: a437683fef6c5783d42ed682401c303be2124401

@sbueringer
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 24, 2023
@k8s-ci-robot k8s-ci-robot merged commit 6f0fe30 into kubernetes-sigs:main May 24, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.5 milestone May 24, 2023
@k8s-infra-cherrypick-robot

@killianmuldoon: new pull request created: #8737

In response to this:

/cherry-pick release-1.4

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-infra-cherrypick-robot

@killianmuldoon: new pull request created: #8738

In response to this:

/cherry-pick release-1.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/control-plane-kubeadm Issues or PRs related to KCP cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restoring the correct apiserver extraArgs configuration will not cause KCP to automatically recovery
5 participants