---
# System prepended metadata

title: Drafts and diagrams

---

# Drafts and diagrams

## High level flow for MachineDeployment

```mermaid
sequenceDiagram
participant Operator

box** Management Cluster**
    participant apiserver as kube-api server
    participant capi as MD controller
    participant msc as MachineSet Controller
    participant mach as Machine Controller
    participant hook as External updater 1
    participant hook2 as External updater 2
end

box Workload Cluster
    participant infra as Infrastructure
end


Operator->>+apiserver: make changes to MD <br>(ExternalUpdate strategy)
apiserver->>+capi: Notify changes
apiserver->>-Operator: OK
capi->>+hook: Can reconcile?
hook->>capi: Set of changes
capi->>+hook2: Can reconcile?
hook2->>capi: Set of changes
capi->>apiserver: Create new MachineSet
loop For all machines
    capi->>apiserver: Add Update Plan to Machine<br> and move to new Machine Set
    apiserver->>msc: Notify changes
    msc->>apiserver: Update Machine Spec
    apiserver->>mach: Notify changes
    mach->>hook: Start update
    hook->>infra: Update components
    loop Until finished
        mach->>hook: finished?
        hook->>mach: try in X secs
    end
    mach->>apiserver: Remove Updater 1 from plan
    mach->>hook2: Start update
    hook2->>infra: Update components
    loop Until finished
        mach->>hook2: finished?
        hook2->>mach: try in X secs
    end
    mach->>apiserver: Remove Updater 2 from plan
    mach->>apiserver: Mark Machine as updated
end
```

## High level flow for KCP

```mermaid
sequenceDiagram
participant Operator

box Management Cluster
participant apiserver as kube-api server
participant capi as KCP controller
participant mach as Machine Controller
participant hook as External updater 1
participant hook2 as External updater 2
end

box Workload Cluster
participant infra as Infrastructure
end


Operator->>+apiserver: make changes to KCP <br>(ExternalUpdate strategy)
apiserver->>+capi: Notify changes
apiserver->>-Operator: OK
capi->>+hook: Can reconcile?
hook->>capi: Set of changes
capi->>+hook2: Can reconcile?
hook2->>capi: Set of changes
loop For all machines
    capi->>apiserver: Add Upgrade Plan to Machine <br> and update Spec 
    apiserver->>mach: Notify changes
    mach->>hook: Start upgrade
    hook->>infra: Update components
    loop Until finished
        mach->>hook: finished?
        hook->>mach: try in X secs
    end
    mach->>apiserver: Remove Upgrader 1 from plan
    mach->>hook2: Start upgrade
    hook2->>infra: Update components
    loop Until finished
        mach->>hook2: finished?
        hook2->>mach: try in X secs
    end
    mach->>apiserver: Mark Machine as upgraded
end
```
