sigs.k8s.io/cluster-api@v1.7.1/docs/proposals/images/machinepool-machines/inframachinepool-scale-down.plantuml (about) 1 @startuml inframachinepool-scale-down 2 repeat :begin reconciling InfraMachinePool; 3 :fetch all InfraMachinePoolMachines; 4 :fetch owner Machine for each InfraMachinePoolMachine; 5 backward:wait for owner Machine to be created; 6 repeat while (any owner Machine is missing) is (yes) 7 -> no; 8 while (for each Machine) 9 if (replica backing Machine does not exist?) then (yes) 10 :delete Machine; 11 else (no) 12 endif 13 endwhile 14 ->no; 15 while (~# ready replicas > # desired replicas?) is (yes) 16 if (a Machine has clusterv1.DeleteMachineAnnotation) then (yes) 17 :select this Machine for deletion; 18 else (no) 19 :select any Machine using any ordering, 20 i.e. failed first, oldest first; 21 endif 22 :delete selected Machine; 23 endwhile 24 ->no; 25 :end reconciling InfraMachinePool; 26 stop 27 @enduml