Skip to content

Commit 38f2938

Browse files
xDev789guettli
andauthored
šŸ› Only wait for api server pod healthy condition if cluster control plane is kubeadm-based (#1607)
Only wait for api server pod healthy condition if cluster control plane is kubeadm-based Co-authored-by: Thomas Güttler <[email protected]>
1 parent 7c5a729 commit 38f2938

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ā€Žpkg/services/hcloud/server/server.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,12 @@ func (s *Service) reconcileLoadBalancerAttachment(ctx context.Context, server *h
311311
return reconcile.Result{}, nil
312312
}
313313

314+
apiServerPodHealthy := s.scope.Cluster.Spec.ControlPlaneRef == nil ||
315+
s.scope.Cluster.Spec.ControlPlaneRef.Kind != "KubeadmControlPlane" ||
316+
conditions.IsTrue(s.scope.Machine, controlplanev1.MachineAPIServerPodHealthyCondition)
317+
314318
// we attach only nodes with kube-apiserver pod healthy to avoid downtime, skipped for the first node
315-
if len(s.scope.HetznerCluster.Status.ControlPlaneLoadBalancer.Target) > 0 &&
316-
!conditions.IsTrue(s.scope.Machine, controlplanev1.MachineAPIServerPodHealthyCondition) {
319+
if len(s.scope.HetznerCluster.Status.ControlPlaneLoadBalancer.Target) > 0 && !apiServerPodHealthy {
317320
return reconcile.Result{RequeueAfter: 30 * time.Second}, nil
318321
}
319322

0 commit comments

Comments
Ā (0)