sigs.k8s.io/cluster-api@v1.7.1/docs/proposals/images/machinepool-api/figure1.plantuml (about) 1 @startuml 2 title Figure 1. MachinePool Provisioning process 3 actor User 4 5 ' -- GROUPS START --- 6 7 box #LightGreen 8 participant "API Server" 9 end box 10 11 box #LightBlue 12 participant "MachinePool Controller" 13 end box 14 15 box #LightGrey 16 participant "Infrastructure Controller" 17 end box 18 19 box #LightGrey 20 participant "Bootstrap Controller" 21 end box 22 23 ' -- GROUPS END --- 24 25 User -> "API Server" : Create MachinePool Infrastructure 26 "API Server" -->> "Infrastructure Controller": New Provider Infrastructure 27 opt IF Infrastructure has no owner ref 28 "Infrastructure Controller"->"Infrastructure Controller": Do Nothing 29 end 30 31 User -> "API Server": Create MachinePool 32 "API Server" -->> "MachinePool Controller": New MachinePool 33 opt #FFFFFFCC Required Only if MachinePool has no owner 34 "MachinePool Controller" -> "MachinePool Controller": Set MachinePool's owner to Cluster 35 "MachinePool Controller" -> "MachinePool Controller": Set MachinePool.Status.Phase to Pending 36 "MachinePool Controller" -> "API Server": Update MachinePool 37 "MachinePool Controller" -> "API Server": Update MachinePool 38 end 39 40 "MachinePool Controller" -> "API Server": Get Bootstrap 41 opt #FFFFFFCC Required Only if Bootstrap has no owner 42 "MachinePool Controller" -> "MachinePool Controller": Set Bootstrap's owner to MachinePool 43 "MachinePool Controller" -> "API Server": Update Bootstrap 44 end 45 opt #FFFFFFCC Required Only if Bootstrap not seen before 46 "MachinePool Controller" -> "MachinePool Controller": Add Watcher for MachinePool.Template.Bootstrap.Kind objects 47 end 48 49 opt #FFFFFFCC If MachinePool in Pending state 50 "Bootstrap Controller"->"Bootstrap Controller": Generate BootstrapConfig.Status.BootstrapData 51 "Bootstrap Controller"->"Bootstrap Controller": Set BootstrapConfig.Status.Ready=true 52 end 53 54 opt #FFFFFFCC If Bootstrap has no Data and Status.BootstrapData 55 "MachinePool Controller"->"MachinePool Controller": Requeue 56 end 57 58 opt #FFFFFFCC If Bootstrap has Data 59 "MachinePool Controller" -> "MachinePool Controller": Set MachinePool.Status.BootstrapReady=true 60 "MachinePool Controller" -> "API Server": Update MachinePool 61 end 62 63 opt #FFFFFFCC If MachinePool.Template.Bootstrap.Data is empty 64 "MachinePool Controller" -> "Bootstrap Controller": Get BootstrapConfig.Status.BootstrapData 65 "MachinePool Controller" -> "MachinePool Controller": Set MachinePool.Template.Bootstrap.Data 66 "MachinePool Controller" -> "MachinePool Controller": Set MachinePool.Status.BootstrapReady=true 67 "MachinePool Controller" -> "API Server": Update MachinePool 68 end 69 70 "MachinePool Controller" -> "API Server": Get Infrastructure 71 opt #FFFFFFCC Required Only if Infrastructure has no owner 72 "MachinePool Controller" -> "MachinePool Controller": Set Infrastructure's owner to MachinePool 73 "MachinePool Controller" -> "MachinePool Controller": Set MachinePool.Status.Phase to Provisioning 74 "MachinePool Controller" -> "API Server": Update Infrastructure 75 end 76 opt #FFFFFFCC Required Only if Infrastructure not seen before 77 "MachinePool Controller" -> "MachinePool Controller": Add Watcher for MachinePool.Template.InfrastructureRef.Kind objects 78 end 79 80 "API Server" -->> "Infrastructure Controller": Infrastructure Update 81 opt #FFFFFFCC Required only if Infrastructure has owner ref 82 "Infrastructure Controller" -> "API Server": Get MachinePool 83 "Infrastructure Controller" -> "Infrastructure Controller": Provision infrastructure 84 "Infrastructure Controller" -> "Infrastructure Controller": Set Infrastructure.Status.Replicas 85 "Infrastructure Controller" -> "Infrastructure Controller": Set Infrastructure.Status.InfrastructureReady=true 86 "Infrastructure Controller" -> "API Server": Update Infrastructure 87 end 88 89 "API Server" -->> "MachinePool Controller": Infrastructure Update 90 opt #FFFFFFCC Only required if Infrastructure.Status.Ready is true 91 "MachinePool Controller" -> "API Server": Get MachinePool 92 "MachinePool Controller" -> "MachinePool Controller": Set MachinePool.Status.Replicas = Infrastructure.Status.Replicas 93 "MachinePool Controller" -> "MachinePool Controller": Set MachinePool.Status.InfrastructureReady = Infrastructure.Status.Ready 94 "MachinePool Controller" -> "API Server": Update MachinePool 95 end 96 97 opt #FFFFFFCC If MachinePool.Status.Ready is true MachinePool.Spec.Replicas != MachinePool.Status.AvailableReplicas 98 "MachinePool Controller" -> "API Server": Get Nodes with MachinePool.Spec.Selector 99 "MachinePool Controller" -> "MachinePool Controller": Update MachinePool.Status UpdatedReplicas, ReadyReplicas, AvailableReplicas, and UnavailableReplicas 100 end 101 102 opt #FFFFFFCC If MachinePool.Status.Ready is true MachinePool.Spec.Replicas != MachinePool.Status.AvailableReplicas 103 "MachinePool Controller"->"MachinePool Controller": Requeue 104 end 105 106 opt #FFFFFFCC If MachinePool.Status.Ready is true MachinePool.Spec.Replicas == MachinePool.Status.AvailableReplicas 107 "MachinePool Controller"->"API Server": Set MachinePool.Status.Phase to "Running" 108 end 109 110 hide footbox 111 @enduml 112