Skip to content

Commit de893a9

Browse files
committed
Add ControlPlane CAEP
1 parent fff5086 commit de893a9

14 files changed

+804
-27
lines changed

docs/proposals/20191017-control-plane.md

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

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

-27
This file was deleted.

0 commit comments

Comments
 (0)