Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📖 CAEP: ControlPlane #1613

Merged
merged 1 commit into from
Nov 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
578 changes: 578 additions & 0 deletions docs/proposals/20191017-kubeadm-based-control-plane.md

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions docs/proposals/images/controlplane/controlplane-init-1.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@startuml
title User creates a Cluster with KubeadmControlPlane
actor User

' -- GROUPS START ---

box #lightgreen
participant "API Server"
end box

box #lightslategray
participant "Cluster API Cluster Controller"
end box

' -- GROUPS END ---

User->"API Server":kubectl apply -f cluster.yaml
"API Server"-->>"Cluster API Cluster Controller": New Cluster

"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Cluster Controller Reconcile
activate "Cluster API Cluster Controller"

note over "Cluster API Cluster Controller": - ✅ Cluster.Status.InfrastructureReady is false\n- ✅ Cluster.Spec.ControlPlaneRef is populated\n- ✅ Cluster.Spec.ControlPlaneRef -> Status.Ready is false

opt Required only if the object hasn't been seen before
"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Add watcher for \nCluster.Spec.ControlPlaneRef.Kind objects
end

opt Required only if the infrastructure object doesn't have a Cluster owner reference
"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Set Cluster.Spec.InfrastructureRef -> OwnerReferences[0] to Cluster
"Cluster API Cluster Controller"->"API Server": Patch AWSCluster
"Cluster API Cluster Controller"<<--"API Server": Response
end

opt Required only if the control plane object doesn't have a Cluster owner reference
"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Set Cluster.Spec.ControlPlaneRef -> OwnerReferences[0] to Cluster
"Cluster API Cluster Controller"->"API Server": Patch KubeadmControlPlane
"Cluster API Cluster Controller"<<--"API Server": Response
end

"Cluster API Cluster Controller"->"API Server": Patch Cluster Status
"Cluster API Cluster Controller"<<--"API Server": Response

deactivate "Cluster API Cluster Controller"

hide footbox
@enduml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions docs/proposals/images/controlplane/controlplane-init-2.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@startuml
title User creates a Cluster with KubeadmControlPlane

' -- GROUPS START ---

box #lightgreen
participant "API Server"
end box

box #violet
participant "KubeadmControlPlane Controller"
end box

' -- GROUPS END ---

note right of "KubeadmControlPlane Controller":Watches KubeadmControlPlanes,\nClusters, and owned Machines

"API Server"-->>"KubeadmControlPlane Controller": Cluster Updated

"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":Enqueues KubeadmControlPlane Reconcile

"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":KubeadmControlPlane Controller Reconcile
activate "KubeadmControlPlane Controller"

note over "KubeadmControlPlane Controller": - ✅ KubeadmControlPlane.OwnerReferences \ncontains a Cluster

"KubeadmControlPlane Controller"->"API Server": Get Cluster
"KubeadmControlPlane Controller"<<--"API Server": Response

note over "KubeadmControlPlane Controller": - ✅ Cluster.Status.InfrastructureReady is true\n- ✅ KubeadmControlPlane instance is valid

"KubeadmControlPlane Controller"->"API Server": Get Machines maching label selector
"KubeadmControlPlane Controller"<<--"API Server": Response

opt KubeadmControlPlane.Spec.Replicas >= 1, no existing Machines found

"KubeadmControlPlane Controller"->"API Server": Create KubeadmConfig from KubeadmControlPlane.Spec.KubeadmConfigSpec
"KubeadmControlPlane Controller"<<--"API Server": Response

"KubeadmControlPlane Controller"->"API Server": Create InfrastructureMachine from KubeadmControlPlane.Spec.InfrastructureTemplate
"KubeadmControlPlane Controller"<<--"API Server": Response

"KubeadmControlPlane Controller"->"API Server": Create Machine using refs from created KubeadmConfig and InfrastructureMachine resources
"KubeadmControlPlane Controller"<<--"API Server": Response

end

"KubeadmControlPlane Controller"->"API Server": Patch KubeadmControlPlane
"KubeadmControlPlane Controller"<<--"API Server": Response

hide footbox
@enduml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions docs/proposals/images/controlplane/controlplane-init-3.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
@startuml
title User creates a Cluster with KubeadmControlPlane

' -- GROUPS START ---

box #lightgreen
participant "API Server"
end box

box #violet
participant "KubeadmControlPlane Controller"
end box

' -- GROUPS END ---

note right of "KubeadmControlPlane Controller":Watches KubeadmControlPlanes,\nClusters, and owned Machines

"API Server"-->>"KubeadmControlPlane Controller": Machine Updated

"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":Enqueues KubeadmControlPlane Reconcile

"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":KubeadmControlPlane Controller Reconcile
activate "KubeadmControlPlane Controller"

note over "KubeadmControlPlane Controller": - ✅ KubeadmControlPlane.OwnerReferences \ncontains a Cluster

"KubeadmControlPlane Controller"->"API Server": Get Cluster
"KubeadmControlPlane Controller"<<--"API Server": Response

note over "KubeadmControlPlane Controller": - ✅ Cluster.Status.InfrastructureReady is true\n- ✅ KubeadmControlPlane instance is valid

"KubeadmControlPlane Controller"->"API Server": Get Machines maching label selector
"KubeadmControlPlane Controller"<<--"API Server": Response

opt KubeadmControlPlane.Spec.Replicas >= 1, 1 or more existing Machines found that is "Ready"

"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":Set KubeadmControlPlane.Status.Initialized = true

opt num Machines matches Replicas, and all Machines "Ready"

"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":Set KubeadmControlPlane.Status.Ready = true

end

end

"KubeadmControlPlane Controller"->"API Server": Patch KubeadmControlPlane
"KubeadmControlPlane Controller"<<--"API Server": Response

hide footbox
@enduml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions docs/proposals/images/controlplane/controlplane-init-4.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@startuml
title User creates a Cluster with KubeadmControlPlane

' -- GROUPS START ---

box #lightgreen
participant "API Server"
end box

box #lightslategray
participant "Cluster API Cluster Controller"
end box

' -- GROUPS END ---

"API Server"-->>"Cluster API Cluster Controller": KubeadmControlPlane updated

"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Cluster Controller Reconcile
activate "Cluster API Cluster Controller"

opt Cluster.Spec.ControlPlaneRef -> Status.Initialized is true

"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Set Cluster.Status.ControlPlaneInitialized = true

opt Cluster.Spec.ControlPlaneRef -> Status.Ready is true

"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Set Cluster.Status.ControlPlaneReady = true

end

end

"Cluster API Cluster Controller"->"API Server": Patch Cluster Status
"Cluster API Cluster Controller"<<--"API Server": Response

deactivate "Cluster API Cluster Controller"

hide footbox
@enduml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions docs/proposals/images/controlplane/controlplane-init-6.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@startuml
title User scales up a KubeadmControlPlane
actor User

' -- GROUPS START ---

box #lightgreen
participant "API Server"
end box

box #violet
participant "KubeadmControlPlane Controller"
end box

' -- GROUPS END ---

User->"API Server":kubectl scale cp/my-control-plane -replicas=3
"API Server"-->>"KubeadmControlPlane Controller": KubeadmControlPlane Updated

"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":Enqueues KubeadmControlPlane Reconcile

"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":KubeadmControlPlane Controller Reconcile
activate "KubeadmControlPlane Controller"

note over "KubeadmControlPlane Controller": - ✅ KubeadmControlPlane.OwnerReferences \ncontains a Cluster

"KubeadmControlPlane Controller"->"API Server": Get Cluster
"KubeadmControlPlane Controller"<<--"API Server": Response

note over "KubeadmControlPlane Controller": - ✅ Cluster.Status.InfrastructureReady is true\n- ✅ KubeadmControlPlane instance is valid

"KubeadmControlPlane Controller"->"API Server": Get Machines maching label selector
"KubeadmControlPlane Controller"<<--"API Server": Response

opt KubeadmControlPlane.Spec.Replicas >= 1, all existing Machines "Ready", num Machines < Replicas

"KubeadmControlPlane Controller"->"API Server": Create KubeadmConfig from KubeadmControlPlane.Spec.KubeadmConfigSpec
"KubeadmControlPlane Controller"<<--"API Server": Response

"KubeadmControlPlane Controller"->"API Server": Create InfrastructureMachine from KubeadmControlPlane.Spec.InfrastructureTemplate
"KubeadmControlPlane Controller"<<--"API Server": Response

"KubeadmControlPlane Controller"->"API Server": Create Machine using refs from created KubeadmConfig and InfrastructureMachine resources
"KubeadmControlPlane Controller"<<--"API Server": Response

end

"KubeadmControlPlane Controller"->"API Server": Update KubeadmControlPlane
"KubeadmControlPlane Controller"<<--"API Server": Response

hide footbox
@enduml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions docs/proposals/images/controlplane/controlplane-init-7.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@startuml
title User scales down a KubeadmControlPlane
actor User

' -- GROUPS START ---

box #lightgreen
participant "API Server"
end box

box #violet
participant "KubeadmControlPlane Controller"
end box

box #lightgreen
participant "Workload Cluster API Server"
end box

' -- GROUPS END ---

User->"API Server":kubectl scale cp/my-control-plane -replicas=1
"API Server"-->>"KubeadmControlPlane Controller": KubeadmControlPlane Updated

"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":Enqueues KubeadmControlPlane Reconcile

"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":KubeadmControlPlane Controller Reconcile
activate "KubeadmControlPlane Controller"

note over "KubeadmControlPlane Controller": - ✅ KubeadmControlPlane.OwnerReferences \ncontains a Cluster

"KubeadmControlPlane Controller"->"API Server": Get Cluster
"KubeadmControlPlane Controller"<<--"API Server": Response

note over "KubeadmControlPlane Controller": - ✅ Cluster.Status.InfrastructureReady is true\n- ✅ KubeadmControlPlane instance is valid

"KubeadmControlPlane Controller"->"API Server": Get Machines maching label selector
"KubeadmControlPlane Controller"<<--"API Server": Response

note over "KubeadmControlPlane Controller": - Process for selecting a Machine to delete is TBD

opt KubeadmControlPlane.Spec.Replicas >= 1, all existing Machines "Ready", num Machines > Replicas

"KubeadmControlPlane Controller"->"Workload Cluster API Server": Remove etcd Member

"KubeadmControlPlane Controller"->"Workload Cluster API Server": Modify kubeadm ConfigMap

"KubeadmControlPlane Controller"->"API Server": Delete a Machine

end

"KubeadmControlPlane Controller"->"API Server": Update KubeadmControlPlane
"KubeadmControlPlane Controller"<<--"API Server": Response

hide footbox
@enduml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 0 additions & 27 deletions docs/proposals/images/machine-states-preboot/README.md

This file was deleted.