Skip to content

Commit 409448c

Browse files
authored
Merge pull request #1613 from detiber/controlPlaneCAEP
📖 CAEP: ControlPlane
2 parents 622d56e + 42eea5f commit 409448c

14 files changed

+874
-27
lines changed

docs/proposals/20191017-kubeadm-based-control-plane.md

+578
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@startuml
2+
title User creates a Cluster with KubeadmControlPlane
3+
actor User
4+
5+
' -- GROUPS START ---
6+
7+
box #lightgreen
8+
participant "API Server"
9+
end box
10+
11+
box #lightslategray
12+
participant "Cluster API Cluster Controller"
13+
end box
14+
15+
' -- GROUPS END ---
16+
17+
User->"API Server":kubectl apply -f cluster.yaml
18+
"API Server"-->>"Cluster API Cluster Controller": New Cluster
19+
20+
"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Cluster Controller Reconcile
21+
activate "Cluster API Cluster Controller"
22+
23+
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
24+
25+
opt Required only if the object hasn't been seen before
26+
"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Add watcher for \nCluster.Spec.ControlPlaneRef.Kind objects
27+
end
28+
29+
opt Required only if the infrastructure object doesn't have a Cluster owner reference
30+
"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Set Cluster.Spec.InfrastructureRef -> OwnerReferences[0] to Cluster
31+
"Cluster API Cluster Controller"->"API Server": Patch AWSCluster
32+
"Cluster API Cluster Controller"<<--"API Server": Response
33+
end
34+
35+
opt Required only if the control plane object doesn't have a Cluster owner reference
36+
"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Set Cluster.Spec.ControlPlaneRef -> OwnerReferences[0] to Cluster
37+
"Cluster API Cluster Controller"->"API Server": Patch KubeadmControlPlane
38+
"Cluster API Cluster Controller"<<--"API Server": Response
39+
end
40+
41+
"Cluster API Cluster Controller"->"API Server": Patch Cluster Status
42+
"Cluster API Cluster Controller"<<--"API Server": Response
43+
44+
deactivate "Cluster API Cluster Controller"
45+
46+
hide footbox
47+
@enduml
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@startuml
2+
title User creates a Cluster with KubeadmControlPlane
3+
4+
' -- GROUPS START ---
5+
6+
box #lightgreen
7+
participant "API Server"
8+
end box
9+
10+
box #violet
11+
participant "KubeadmControlPlane Controller"
12+
end box
13+
14+
' -- GROUPS END ---
15+
16+
note right of "KubeadmControlPlane Controller":Watches KubeadmControlPlanes,\nClusters, and owned Machines
17+
18+
"API Server"-->>"KubeadmControlPlane Controller": Cluster Updated
19+
20+
"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":Enqueues KubeadmControlPlane Reconcile
21+
22+
"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":KubeadmControlPlane Controller Reconcile
23+
activate "KubeadmControlPlane Controller"
24+
25+
note over "KubeadmControlPlane Controller": - ✅ KubeadmControlPlane.OwnerReferences \ncontains a Cluster
26+
27+
"KubeadmControlPlane Controller"->"API Server": Get Cluster
28+
"KubeadmControlPlane Controller"<<--"API Server": Response
29+
30+
note over "KubeadmControlPlane Controller": - ✅ Cluster.Status.InfrastructureReady is true\n- ✅ KubeadmControlPlane instance is valid
31+
32+
"KubeadmControlPlane Controller"->"API Server": Get Machines maching label selector
33+
"KubeadmControlPlane Controller"<<--"API Server": Response
34+
35+
opt KubeadmControlPlane.Spec.Replicas >= 1, no existing Machines found
36+
37+
"KubeadmControlPlane Controller"->"API Server": Create KubeadmConfig from KubeadmControlPlane.Spec.KubeadmConfigSpec
38+
"KubeadmControlPlane Controller"<<--"API Server": Response
39+
40+
"KubeadmControlPlane Controller"->"API Server": Create InfrastructureMachine from KubeadmControlPlane.Spec.InfrastructureTemplate
41+
"KubeadmControlPlane Controller"<<--"API Server": Response
42+
43+
"KubeadmControlPlane Controller"->"API Server": Create Machine using refs from created KubeadmConfig and InfrastructureMachine resources
44+
"KubeadmControlPlane Controller"<<--"API Server": Response
45+
46+
end
47+
48+
"KubeadmControlPlane Controller"->"API Server": Patch KubeadmControlPlane
49+
"KubeadmControlPlane Controller"<<--"API Server": Response
50+
51+
hide footbox
52+
@enduml
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
@startuml
2+
title User creates a Cluster with KubeadmControlPlane
3+
4+
' -- GROUPS START ---
5+
6+
box #lightgreen
7+
participant "API Server"
8+
end box
9+
10+
box #violet
11+
participant "KubeadmControlPlane Controller"
12+
end box
13+
14+
' -- GROUPS END ---
15+
16+
note right of "KubeadmControlPlane Controller":Watches KubeadmControlPlanes,\nClusters, and owned Machines
17+
18+
"API Server"-->>"KubeadmControlPlane Controller": Machine Updated
19+
20+
"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":Enqueues KubeadmControlPlane Reconcile
21+
22+
"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":KubeadmControlPlane Controller Reconcile
23+
activate "KubeadmControlPlane Controller"
24+
25+
note over "KubeadmControlPlane Controller": - ✅ KubeadmControlPlane.OwnerReferences \ncontains a Cluster
26+
27+
"KubeadmControlPlane Controller"->"API Server": Get Cluster
28+
"KubeadmControlPlane Controller"<<--"API Server": Response
29+
30+
note over "KubeadmControlPlane Controller": - ✅ Cluster.Status.InfrastructureReady is true\n- ✅ KubeadmControlPlane instance is valid
31+
32+
"KubeadmControlPlane Controller"->"API Server": Get Machines maching label selector
33+
"KubeadmControlPlane Controller"<<--"API Server": Response
34+
35+
opt KubeadmControlPlane.Spec.Replicas >= 1, 1 or more existing Machines found that is "Ready"
36+
37+
"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":Set KubeadmControlPlane.Status.Initialized = true
38+
39+
opt num Machines matches Replicas, and all Machines "Ready"
40+
41+
"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":Set KubeadmControlPlane.Status.Ready = true
42+
43+
end
44+
45+
end
46+
47+
"KubeadmControlPlane Controller"->"API Server": Patch KubeadmControlPlane
48+
"KubeadmControlPlane Controller"<<--"API Server": Response
49+
50+
hide footbox
51+
@enduml
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
@startuml
2+
title User creates a Cluster with KubeadmControlPlane
3+
4+
' -- GROUPS START ---
5+
6+
box #lightgreen
7+
participant "API Server"
8+
end box
9+
10+
box #lightslategray
11+
participant "Cluster API Cluster Controller"
12+
end box
13+
14+
' -- GROUPS END ---
15+
16+
"API Server"-->>"Cluster API Cluster Controller": KubeadmControlPlane updated
17+
18+
"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Cluster Controller Reconcile
19+
activate "Cluster API Cluster Controller"
20+
21+
opt Cluster.Spec.ControlPlaneRef -> Status.Initialized is true
22+
23+
"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Set Cluster.Status.ControlPlaneInitialized = true
24+
25+
opt Cluster.Spec.ControlPlaneRef -> Status.Ready is true
26+
27+
"Cluster API Cluster Controller"-> "Cluster API Cluster Controller":Set Cluster.Status.ControlPlaneReady = true
28+
29+
end
30+
31+
end
32+
33+
"Cluster API Cluster Controller"->"API Server": Patch Cluster Status
34+
"Cluster API Cluster Controller"<<--"API Server": Response
35+
36+
deactivate "Cluster API Cluster Controller"
37+
38+
hide footbox
39+
@enduml
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@startuml
2+
title User scales up a KubeadmControlPlane
3+
actor User
4+
5+
' -- GROUPS START ---
6+
7+
box #lightgreen
8+
participant "API Server"
9+
end box
10+
11+
box #violet
12+
participant "KubeadmControlPlane Controller"
13+
end box
14+
15+
' -- GROUPS END ---
16+
17+
User->"API Server":kubectl scale cp/my-control-plane -replicas=3
18+
"API Server"-->>"KubeadmControlPlane Controller": KubeadmControlPlane Updated
19+
20+
"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":Enqueues KubeadmControlPlane Reconcile
21+
22+
"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":KubeadmControlPlane Controller Reconcile
23+
activate "KubeadmControlPlane Controller"
24+
25+
note over "KubeadmControlPlane Controller": - ✅ KubeadmControlPlane.OwnerReferences \ncontains a Cluster
26+
27+
"KubeadmControlPlane Controller"->"API Server": Get Cluster
28+
"KubeadmControlPlane Controller"<<--"API Server": Response
29+
30+
note over "KubeadmControlPlane Controller": - ✅ Cluster.Status.InfrastructureReady is true\n- ✅ KubeadmControlPlane instance is valid
31+
32+
"KubeadmControlPlane Controller"->"API Server": Get Machines maching label selector
33+
"KubeadmControlPlane Controller"<<--"API Server": Response
34+
35+
opt KubeadmControlPlane.Spec.Replicas >= 1, all existing Machines "Ready", num Machines < Replicas
36+
37+
"KubeadmControlPlane Controller"->"API Server": Create KubeadmConfig from KubeadmControlPlane.Spec.KubeadmConfigSpec
38+
"KubeadmControlPlane Controller"<<--"API Server": Response
39+
40+
"KubeadmControlPlane Controller"->"API Server": Create InfrastructureMachine from KubeadmControlPlane.Spec.InfrastructureTemplate
41+
"KubeadmControlPlane Controller"<<--"API Server": Response
42+
43+
"KubeadmControlPlane Controller"->"API Server": Create Machine using refs from created KubeadmConfig and InfrastructureMachine resources
44+
"KubeadmControlPlane Controller"<<--"API Server": Response
45+
46+
end
47+
48+
"KubeadmControlPlane Controller"->"API Server": Update KubeadmControlPlane
49+
"KubeadmControlPlane Controller"<<--"API Server": Response
50+
51+
hide footbox
52+
@enduml
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
@startuml
2+
title User scales down a KubeadmControlPlane
3+
actor User
4+
5+
' -- GROUPS START ---
6+
7+
box #lightgreen
8+
participant "API Server"
9+
end box
10+
11+
box #violet
12+
participant "KubeadmControlPlane Controller"
13+
end box
14+
15+
box #lightgreen
16+
participant "Workload Cluster API Server"
17+
end box
18+
19+
' -- GROUPS END ---
20+
21+
User->"API Server":kubectl scale cp/my-control-plane -replicas=1
22+
"API Server"-->>"KubeadmControlPlane Controller": KubeadmControlPlane Updated
23+
24+
"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":Enqueues KubeadmControlPlane Reconcile
25+
26+
"KubeadmControlPlane Controller"-> "KubeadmControlPlane Controller":KubeadmControlPlane Controller Reconcile
27+
activate "KubeadmControlPlane Controller"
28+
29+
note over "KubeadmControlPlane Controller": - ✅ KubeadmControlPlane.OwnerReferences \ncontains a Cluster
30+
31+
"KubeadmControlPlane Controller"->"API Server": Get Cluster
32+
"KubeadmControlPlane Controller"<<--"API Server": Response
33+
34+
note over "KubeadmControlPlane Controller": - ✅ Cluster.Status.InfrastructureReady is true\n- ✅ KubeadmControlPlane instance is valid
35+
36+
"KubeadmControlPlane Controller"->"API Server": Get Machines maching label selector
37+
"KubeadmControlPlane Controller"<<--"API Server": Response
38+
39+
note over "KubeadmControlPlane Controller": - Process for selecting a Machine to delete is TBD
40+
41+
opt KubeadmControlPlane.Spec.Replicas >= 1, all existing Machines "Ready", num Machines > Replicas
42+
43+
"KubeadmControlPlane Controller"->"Workload Cluster API Server": Remove etcd Member
44+
45+
"KubeadmControlPlane Controller"->"Workload Cluster API Server": Modify kubeadm ConfigMap
46+
47+
"KubeadmControlPlane Controller"->"API Server": Delete a Machine
48+
49+
end
50+
51+
"KubeadmControlPlane Controller"->"API Server": Update KubeadmControlPlane
52+
"KubeadmControlPlane Controller"<<--"API Server": Response
53+
54+
hide footbox
55+
@enduml
Loading

docs/proposals/images/machine-states-preboot/README.md

-27
This file was deleted.

0 commit comments

Comments
 (0)