-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcluster-create.puml
173 lines (132 loc) · 4.82 KB
/
cluster-create.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
@startuml
header **CB-Ladybug** (v0.7.0-cortado)
title Create a cluster
hide footbox
participant "Client" as webtool #d1e0ff
participant "Ladybug" as provider
database "Ladybug data" as db
participant "Tumblebug" as tumblebug #d1e0ff
participant "Nodes" as nodes #eeeeee
participant "Control plane" as mNodes #eeeeee
participant "Worker nodes" as wNodes #eeeeee
skinparam sequence {
GroupColor DeepSkyBlue
}
activate webtool
webtool -> provider : POST/ns/:ns/clusters/:cluster\n{name, controlPlane:{}, workrer:{}, config:{}}
activate provider
'-- 1.validation
alt validation
'-- 1.1. namespace
provider -> tumblebug : GET /ns/:ns
tumblebug --> provider : {namespace}
provider -> webtool : error (if it does not exist)
'-- 1.2. connection
provider -> tumblebug : GET /connConfig/:connection
tumblebug --> provider : {connection}
provider -> webtool : error (if it does not exist)
'-- 1.2. connection
provider -> provider : check control-plane & worker count
provider -> webtool : error (if it is wrong)
'-- 1.3. Ladybug
provider -> db : select()
db --> provider : {mcks}
provider -> webtool : [if it exists] error
'-- 1.4. UpdatePhase
provider -> db : UpdatePhase()
'-- 1.6. validate exists a MCIS
provider -> tumblebug : GET /ns/:ns/mcis/:mcis
tumblebug --> provider : {mcis}
provider -> webtool : [if it exists] error
end
'-- 2.Create a MCIR
loop target connections(regions)
alt validate MCIR
'-- 2.1 validate CSP
provider -> provider : validate CSP
provider -> webtool : error (if CSP does not exist)
'-- 2.2 validate spec.
provider -> tumblebug : POST /lookupSpec
tumblebug --> provider : {spec}
provider -> webtool : [if it does not exist]
'-- 2.3 validate region
provider -> tumblebug : GET /region/:region
tumblebug --> provider : {region}
provider -> webtool : [if it does not exist]
end
alt create a MCIR
'-- 2.4. vpc
provider -> tumblebug : GET /ns/:ns/resources/vNet/:vpc
tumblebug --> provider : {vpc}
provider -> tumblebug : [if it does not exist]\nPOST s/:ns/resources/vNet
tumblebug --> provider : {vpc}
provider -> webtool : [if there is an error] error
'-- 2.5. sg(fw)
provider -> tumblebug : GET /ns/:ns/resources/securityGroup/:sg
tumblebug --> provider : {securityGroup}
provider -> tumblebug : [if it does not exist]\nPOST /ns/:ns/resources/securityGroup
tumblebug --> provider : {securityGroup}
provider -> webtool : [if there is an error] error
'-- 2.6. ssh
provider -> tumblebug : GET /ns/:ns/resources/sshKey/:key
tumblebug --> provider : {keypair}
provider -> tumblebug : [if it does not exist] POST /ns/:ns/resources/sshKey
tumblebug --> provider : {keypair}
provider -> webtool : [if there is an error] error
'-- 2.7. image
provider -> tumblebug : GET /ns/:ns/resources/image/:image
tumblebug --> provider : {image}
provider -> tumblebug : [if it does not exist]\nPOST /ns/:ns/resources/image
tumblebug --> provider : {image}
provider -> webtool : [if there is an error] error
'-- 2.8. spec
provider -> tumblebug : GET /ns/:ns/resources/spec/:spec
tumblebug --> provider : {spec}
provider -> tumblebug : [if it does not exist]\nPOST /ns/:ns/resources/spec
tumblebug --> provider : {spec}
provider -> webtool : [if there is an error] error
end
end
'-- 3. create a MCIS
alt create a MCIS (VMs)
provider -> provider : append VMs (while node count)
provider -> tumblebug : POST /ns/:ns/mcis/:mcis
tumblebug --> provider : {mcis}
provider -> webtool : [if there is an error] error
end
' -- 4. boostrap
alt bootstrap
loop VMs
provider <->o nodes : test ssh connection
provider <->o nodes : copy scripts
provider <->o nodes : systemd
provider <->o nodes : bootstrap
provider -> webtool : [if there is an error] error
end
end
' -- 5 control-plane init
alt control-plane init (leader of control-plane VM)
provider <->o mNodes : haproxy / nlb
provider <->o mNodes : init
provider <->o mNodes : install network CNI
provider -> webtool : [if there is an error] error
end
' -- 6. control-plane join
alt control-plane join
loop not leader of control-plane VMs
provider <->o mNodes : join (not leader of control-plane VMs)
provider -> webtool : [if there is an error] error
end
end
' -- 67 worker join
alt wokers join
loop woker VMs
provider <->o wNodes : join
provider -> webtool : [if there is an error] error
end
end
deactivate provider
provider -> db : complete {cluster}
provider --> webtool : {cluster}
deactivate webtool
@enduml