Skip to content

Commit

Permalink
Merge pull request #8711 from killianmuldoon/pr-reorder-cert-expiry
Browse files Browse the repository at this point in the history
🐛 Allow machine rollout if cert reconcile fails
  • Loading branch information
k8s-ci-robot authored May 24, 2023
2 parents 2f2f086 + a3a02e6 commit 6f0fe30
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions controlplane/kubeadm/internal/controllers/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,6 @@ func (r *KubeadmControlPlaneReconciler) reconcile(ctx context.Context, cluster *
return result, err
}

// Reconcile certificate expiry for machines that don't have the expiry annotation on KubeadmConfig yet.
if result, err := r.reconcileCertificateExpiries(ctx, controlPlane); err != nil || !result.IsZero() {
return result, err
}

// Control plane machines rollout due to configuration changes (e.g. upgrades) takes precedence over other operations.
needRollout := controlPlane.MachinesNeedingRollout()
switch {
Expand Down Expand Up @@ -445,6 +440,14 @@ 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 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.
if result, err := r.reconcileCertificateExpiries(ctx, controlPlane); err != nil || !result.IsZero() {
return result, err
}

return ctrl.Result{}, nil
}

Expand Down

0 comments on commit 6f0fe30

Please sign in to comment.