@startuml cluster_reconcile start split :EKS-A Cluster change; split again split :CAPI Cluster change; split again :CAPI KubeadmControlPlane change; split again :CAPI MachineDeployment change; end split #LightBlue:Get EKS-A cluster using cluster name label; end split repeat :Cluster controller enqueues a Reconcile call; if (Deleted?) then (yes) :Reconcile deletion; else (no) :Reconcile control plane; #LightBlue:Get CAPI cluster for EKS-A Cluster; if (Cluster nil) then (no) if (External Etcd) then (yes) if (CAPI cluster ManagedEtcdReady) then (true) else (false) break endif else (no) endif if (CAPI cluster ControlPlaneReady) then (true) :Reconcile CNI; #LightBlue:Get CAPI KubeadmControlPlane for EKS-A Cluster; if (KubeadmControlPlane nil) then (no) if (KubeadmControlPlane Ready == true\n and UnavailableReplicas == 0\n and ReadyReplicas == Replicas) then (true) :Reconcile Workers; #LightBlue:Get Worker MachineDeployments for EKS-A Cluster; if (All MachineDeployments Phase == "Running"\n and UnavailableReplicas == 0\n and ReadyReplicas == Replicas) then (yes) :Reconcile extra objects; #LightGreen:Cluster reconciled; else (no) endif else (false) endif else (yes) :Requeue; endif else (false) endif else (yes) :Requeue; endif endif repeat while (Reconcile returned RequeueError?) is (yes) if (Reconcile returned error) then (yes) #Pink:Error reconciling cluster; else (no) endif stop @enduml