forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spring-cloud-hostingack-service.yml
582 lines (582 loc) · 20.3 KB
/
spring-cloud-hostingack-service.yml
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: This template seamlessly migrates Spring Cloud applications to Container Service
for Kubernetes at low costs, without changes to the calling method between applications.
Kubernetes is a natural fit for microservices. This template takes full advantage
of the elasticity of Kubernetes to meet application scale-out requirements. After
Spring Cloud applications are containerized, resource utilization is greatly improved.
zh-cn: 无需改造即可迁移,应用间的调用都是原来的方式;平滑迁移,迁移成本小;kubernetes天然适合微服务框架;充分利用kubernetes的弹性,满足应用弹性扩容需求;容器化后,资源利用率获得极大提升。
Parameters:
VpcCidrBlock:
Type: String
Label:
en: VPC CIDR Block
zh-cn: 专有网络网段
Description:
en: 'The IP address range of the VPC in the CIDR Block form; <br>you can use
the following IP address ranges: <br><font color=''green''>[10.0.0.0/8]</font><br><font
color=''green''>[192.168.0.0/16]</font>'
zh-cn: 专有网络IP地址段范围,<br>您可以使用以下的IP地址段:<br><font color='green'>[10.0.0.0/8]</font><br><font
color='green'>[192.168.0.0/16]</font>
Default: 192.168.0.0/16
AllowedValues:
- 192.168.0.0/16
- 10.0.0.0/8
VSwitch1CidrBlock:
Type: String
Label:
en: VSwitch 1 CIDR Block
zh-cn: 交换机1网段
Description:
en: Must be a sub-network segment of the proprietary network and is not occupied
by other VSwitches.
zh-cn: 必须是所属专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.1.0/24
VSwitch1ZoneId:
Type: String
Label:
en: VSwitch 1 Availability Zone
zh-cn: 交换机1可用区
Description:
en: Availability Zone ID.<br><b>note:<font color='blue'>before selecting, please
confirm that the Availability Zone supports the specification of creating
ECS resources,which is recommended to be different from other VSwitch Availability
Zone</font></b>
zh-cn: 可用区ID。<br><b>注: <font color='blue'>选择前请确认该可用区是否支持创建ECS资源的规格,建议与其他交换机可用区不同</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
VSwitch2CidrBlock:
Type: String
Label:
en: VSwitch 2 CIDR Block
zh-cn: 交换机2网段
Description:
en: Must be a sub-network segment of the proprietary network and is not occupied
by other VSwitches.
zh-cn: 必须是所属专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.2.0/24
VSwitch2ZoneId:
Type: String
Label:
en: VSwitch 2 Availability Zone
zh-cn: 交换机2可用区
Description:
en: Availability Zone ID.<br><b>note:<font color='blue'>before selecting, please
confirm that the Availability Zone supports the specification of creating
ECS resources,which is recommended to be different from other VSwitch Availability
Zone</font></b>
zh-cn: 可用区ID。<br><b>注: <font color='blue'>选择前请确认该可用区是否支持创建ECS资源的规格,建议与其他交换机可用区不同</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
VSwitch3CidrBlock:
Type: String
Label:
en: VSwitch 3 CIDR Block
zh-cn: 交换机3网段
Description:
en: Must be a sub-network segment of the proprietary network and is not occupied
by other VSwitches.
zh-cn: 必须是所属专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.3.0/24
VSwitch3ZoneId:
Type: String
Label:
en: VSwitch 3 Availability Zone
zh-cn: 交换机3可用区
Description:
en: Availability Zone ID.<br><b>note:<font color='blue'>before selecting, please
confirm that the Availability Zone supports the specification of creating
ECS resources,which is recommended to be different from other VSwitch Availability
Zone</font></b>
zh-cn: 可用区ID。<br><b>注: <font color='blue'>选择前请确认该可用区是否支持创建ECS资源的规格,建议与其他交换机可用区不同</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
EipBandwidth:
Type: Number
Label:
en: EIP Bandwidth
zh-cn: 弹性IP带宽峰值
Description:
en: 'Value range: [1, 1000], unit: Mbps.'
zh-cn: '取值范围: [1, 1000],单位:Mbps。'
ConstraintDescription:
en: 'Value range: [1, 1000], unit: Mbps.'
zh-cn: '取值范围: [1, 1000],单位:Mbps。'
Default: 10
MinValue: 1
MaxValue: 1000
EipInternetChargeType:
Type: String
Label:
en: EIP Billing Method
zh-cn: 弹性公网IP计费类型
Description:
en: 'Billing method. <br><font color=''blue''><b>Optional values:</b></font><br>[PayByBandwidth:
<font color=''green''>Pay-by-bandwidth</font>]<br>[PayByTraffic: <font color=''green''>Pay-by-data-transfer</font>]</a>'
zh-cn: '计费类型。<br><font color=''blue''><b>可选值:</b></font><br>[PayByBandwidth:
<font color=''green''>按带宽计费</font>]<br>[PayByTraffic: <font color=''green''>按流量计费</font>]</a>'
Default: PayByTraffic
AllowedValues:
- PayByBandwidth
- PayByTraffic
ContainerCidr:
Type: String
Label:
en: Pod Network CIDR
zh-cn: Pod网络网段
Description:
en: The service network segment cannot conflict with VPC and the network segment
already used by Kubernetes cluster in VPC, and cannot be modified after creation.
zh-cn: 服务网络段不能与VPC和VPC内已有Kubernetes集群使用的网段冲突,创建后不能修改。
Default: 172.16.0.0/16
ServiceCidr:
Type: String
Label:
en: Service CIDR
zh-cn: Service CIDR
Description:
en: The service network segment cannot conflict with VPC and the network segment
already used by Kubernetes cluster in VPC, and cannot be modified after creation.
zh-cn: 服务网络段不能与VPC和VPC内已有Kubernetes集群使用的网段冲突,创建后不能修改。
Default: 172.19.0.0/20
NumOfNodes:
Type: Number
Label:
en: Number Of Worker Nodes
zh-cn: Worker节点数
Description:
en: Number of worker nodes. The range is [0,300].
zh-cn: Worker节点数,范围是[0,300]。
ConstraintDescription:
en: Number of worker nodes. The range is [0,300].
zh-cn: Worker节点数,范围是[0,300]。
Default: 3
MinValue: 0
MaxValue: 300
MasterCount:
Type: Number
Label:
en: Master Count
zh-cn: Master实例个数
Description:
en: Number of master instances. The value can be 3 or 5.
zh-cn: 主实例的数量。可用值3或5。
Default: 3
AllowedValues:
- 3
- 5
MasterInstanceTypes:
Type: String
Label:
en: Master Instance Types
zh-cn: Master节点实例规格
Description:
en: 'Fill in the specifications that can be used under the VSwitch availability
zone, Three ECS instance specifications must be filled in. ECS instance specifications
can be repeated,separated by commas. </b></font><br>general specifications:<font
color=''red''><b>ecs.c5.large</b></font><br>note: a few zones do not support
general specifications<br>see detail: <a href=''https://www.alibabacloud.com/help/en/doc-detail/25378.html''
target=''_blank''><b><font color=''blue''>Instance Specification Family</font></a></b>'
zh-cn: 填写VSwitch可用区下可使用的规格,必须填写3个ECS实例规格,ECS实例规格可以重复,以英文逗号分隔;<br>通用规格:<font
color='red'><b>ecs.c5.large</b></font><br>注:可用区可能不支持通用规格<br>规格详见:<a href='https://help.aliyun.com/document_detail/25378.html'
target='_blank'><b><font color='blue'>实例规格族</font></a></b>
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
MasterSystemDiskCategory:
Type: String
Label:
en: Master System Disk Category
zh-cn: Master节点系统盘类型
Description:
en: '<font color=''blue''><b>Optional values:</b></font><br>[cloud_efficiency:
<font color=''green''>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color=''green''>SSD
Cloud Disk</font>]'
zh-cn: '<font color=''blue''><b>可选值:</b></font><br>[cloud_efficiency: <font
color=''green''>高效云盘</font>]<br>[cloud_ssd: <font color=''green''>SSD云盘</font>]'
Default: cloud_ssd
AllowedValues:
- cloud_efficiency
- cloud_ssd
MasterSystemDiskSize:
Type: Number
Label:
en: Master System Disk Size
zh-cn: Master节点系统盘大小
Description:
en: 'Worker disk system size, range of values: 40-500, units: GB.'
zh-cn: 工作盘系统磁盘大小, 取值范围:[40, 500], 单位:GB。
ConstraintDescription:
en: 'Worker disk system size, range of values: 40-500, units: GB.'
zh-cn: 工作盘系统磁盘大小, 取值范围:[40, 500], 单位:GB。
Default: 120
MinValue: 40
MaxValue: 500
WorkerSystemDiskCategory:
Type: String
Label:
en: Worker System Disk Category
zh-cn: Worker节点系统盘类型
Description:
en: '<font color=''blue''><b>Optional values:</b></font><br>[cloud_efficiency:
<font color=''green''>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color=''green''>SSD
Cloud Disk</font>]'
zh-cn: '<font color=''blue''><b>可选值:</b></font><br>[cloud_efficiency: <font
color=''green''>高效云盘</font>]<br>[cloud_ssd: <font color=''green''>SSD云盘</font>]'
Default: cloud_efficiency
AllowedValues:
- cloud_efficiency
- cloud_ssd
WorkerSystemDiskSize:
Type: Number
Label:
en: Worker System Disk Size
zh-cn: Worker节点系统盘大小
Description:
en: 'Worker disk system disk size, range of values: 40-500, the unit is GiB.'
zh-cn: 工作盘系统磁盘大小,取值范围:[40, 500], 单位是GiB。
ConstraintDescription:
en: 'Worker disk system disk size, range of values: 40-500, the unit is GiB.'
zh-cn: 工作盘系统磁盘大小,取值范围:[40, 500], 单位是GiB。
Default: 120
MinValue: 40
MaxValue: 500
WorkerInstanceTypes:
Type: String
Label:
en: Worker Instance Types
zh-cn: Worker节点实例规格
Description:
en: 'Fill in the specifications that can be used under the VSwitch availability
zone, at least 2 ECS instance specifications must be filled in. ECS instance
specifications can be repeated,separated by commas. </b></font><br>general
specifications:<font color=''red''><b>ecs.c5.large</b></font><br>note: a few
zones do not support general specifications<br>see detail: <a href=''https://www.alibabacloud.com/help/en/doc-detail/25378.html''
target=''_blank''><b><font color=''blue''>Instance Specification Family</font></a></b>'
zh-cn: 填写VSwitch可用区下可使用的规格,必须填写至少2个ECS实例规格,ECS实例规格可以重复,以英文逗号分隔;<br>通用规格:<font
color='red'><b>ecs.c5.large</b></font><br>注:可用区可能不支持通用规格<br>规格详见:<a href='https://help.aliyun.com/document_detail/25378.html'
target='_blank'><b><font color='blue'>实例规格族</font></a></b>
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
SshFlags:
Type: Boolean
Label:
en: SSH Login
zh-cn: SSH登录
Description:
en: 'Whether to enable public network SSH login:<br>[check: <font color=''green''>open</font>]<br>[uncheck:
<font color=''green''>not open</font>]'
zh-cn: '是否启用公共网络SSH登录:<br>[勾选: <font color=''green''>启用</font>]<br>[不勾选: <font
color=''green''>不启用</font>]'
Default: true
AllowedValues:
- 'true'
- 'false'
SnatEntry:
Type: Boolean
Label:
en: Snat Entry
zh-cn: 是否为网络配置SNAT
Description:
en: 'Whether to configure SNAT for the network.When a VPC can access the public
network environment, set it to false.When an existing VPC cannot access the
public network environment:<br>[check: <font color=''green''>SNAT is configured
and the public network environment can be accessed at this time</font>]<br>[uncheck:
<font color=''green''>it means that SNAT is not configured and the public
network environment cannot be accessed at this time</font>]'
zh-cn: '是否为网络配置SNAT。当VPC可以访问公共网络环境时,将其设置为false。当现有的VPC无法访问公共网络环境时:<br>[勾选: <font
color=''green''>配置SNAT,此时可以访问公共网络环境</font>]<br>[不勾选: <font color=''green''>则表示没有配置SNAT,此时不能访问公共网络环境</font>]'
Default: true
AllowedValues:
- true
- false
KubernetesVersion:
Type: String
Label:
en: Version
zh-cn: 版本
Description:
en: 'Value range: 1.12.6-aliyun1, 1.14.8-aliyun1'
zh-cn: 取值范围:1.12.6-aliyun.1,1.14.8-aliyun.1
Default: 1.12.6-aliyun.1
AllowedValues:
- 1.12.6-aliyun.1
- 1.14.8-aliyun.1
EndpointPublicAccess:
Type: Boolean
Label:
en: Endpoint Public Access
zh-cn: 是否开启公网APIServer
Description:
en: 'Whether to enable the public network API Server:<br>[check: <font color=''green''>which
means that the public network API Server is open</font>]<br>[uncheck: <font
color=''green''>the API server on the public network will not be created,
only the API server on the private network will be created</font>]'
zh-cn: '是否启用公共网络API服务器:<br>[勾选: <font color=''green''>表示公共网络API服务器是打开的</font>]<br>[不勾选:
<font color=''green''>将不创建公共网络上的API服务器,只创建私有网络上的API服务器</font>]'
Default: true
AllowedValues:
- 'true'
- 'false'
LoginPassword:
Type: String
Label:
en: Login Password
zh-cn: 登录密码
Description:
en: Server login password, Length 8-30, must contain three(Capital letters,
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol
in).
zh-cn: 服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
ConstraintDescription:
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers,
()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
MinLength: 8
MaxLength: 30
NoEcho: true
Resources:
Eip:
Type: ALIYUN::VPC::EIP
Properties:
Bandwidth:
Ref: EipBandwidth
InternetChargeType:
Ref: EipInternetChargeType
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
VSwitch1:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwitch1ZoneId
VpcId:
Fn::GetAtt:
- Vpc
- VpcId
CidrBlock:
Ref: VSwitch1CidrBlock
VSwitchName:
Fn::Join:
- '-'
- - VSwitch1
- StackId
- Ref: ALIYUN::StackId
NatGateway:
Type: ALIYUN::VPC::NatGateway
Properties:
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch1
DeletionForce: true
NatGatewayName:
Fn::Join:
- '-'
- - VSwitch1
- StackId
- Ref: ALIYUN::StackId
VpcEipAssociationNatGateway:
Type: ALIYUN::VPC::EIPAssociation
Properties:
InstanceId:
Ref: NatGateway
AllocationId:
Ref: Eip
Mode: NAT
DependsOn:
- NatGateway
- Vpc
SNatEntry1:
Type: ALIYUN::ECS::SNatEntry
Properties:
SNatIp:
Fn::GetAtt:
- Eip
- EipAddress
SNatTableId:
Fn::GetAtt:
- NatGateway
- SNatTableId
SourceVSwitchId:
Fn::GetAtt:
- VSwitch1
- VSwitchId
DependsOn:
- Eip
- VSwitch1
- VpcEipAssociationNatGateway
VSwitch2:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwitch2ZoneId
VpcId:
Fn::GetAtt:
- Vpc
- VpcId
CidrBlock:
Ref: VSwitch2CidrBlock
VSwitchName:
Fn::Join:
- '-'
- - VSwitch2
- StackId
- Ref: ALIYUN::StackId
SNatEntry2:
Type: ALIYUN::ECS::SNatEntry
Properties:
SNatIp:
Fn::GetAtt:
- Eip
- EipAddress
SNatTableId:
Fn::GetAtt:
- NatGateway
- SNatTableId
SourceVSwitchId:
Fn::GetAtt:
- VSwitch2
- VSwitchId
DependsOn: SNatEntry1
VSwitch3:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwitch3ZoneId
VpcId:
Fn::GetAtt:
- Vpc
- VpcId
CidrBlock:
Ref: VSwitch3CidrBlock
VSwitchName:
Fn::Join:
- '-'
- - VSwitch3
- StackId
- Ref: ALIYUN::StackId
SNatEntry3:
Type: ALIYUN::ECS::SNatEntry
Properties:
SNatIp:
Fn::GetAtt:
- Eip
- EipAddress
SNatTableId:
Fn::GetAtt:
- NatGateway
- SNatTableId
SourceVSwitchId:
Fn::GetAtt:
- VSwitch3
- VSwitchId
DependsOn: SNatEntry2
SecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: Vpc
SecurityGroupName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Tags:
- Key: best_practice
Value: '044'
Cluster:
Type: ALIYUN::CS::KubernetesCluster
Properties:
VpcId:
Ref: Vpc
MasterVSwitchIds:
- Ref: VSwitch1
- Ref: VSwitch2
- Ref: VSwitch3
WorkerVSwitchIds:
- Ref: VSwitch1
- Ref: VSwitch2
- Ref: VSwitch3
SecurityGroupId:
Ref: SecurityGroup
ContainerCidr:
Ref: ContainerCidr
KubernetesVersion:
Ref: KubernetesVersion
LoginPassword:
Ref: LoginPassword
MasterCount:
Ref: MasterCount
MasterInstanceTypes:
Fn::Split:
- ','
- Ref: MasterInstanceTypes
MasterSystemDiskCategory:
Ref: MasterSystemDiskCategory
MasterSystemDiskSize:
Ref: MasterSystemDiskSize
Name:
Fn::Join:
- '-'
- - KubernetesCluster
- Ref: ALIYUN::StackId
NumOfNodes:
Ref: NumOfNodes
ServiceCidr:
Ref: ServiceCidr
SnatEntry:
Ref: SnatEntry
SshFlags:
Ref: SshFlags
Tags:
- Key: best_practice
Value: '044'
WorkerInstanceTypes:
Fn::Split:
- ','
- Ref: WorkerInstanceTypes
WorkerSystemDiskCategory:
Ref: WorkerSystemDiskCategory
WorkerSystemDiskSize:
Ref: WorkerSystemDiskSize
DependsOn:
- SNatEntry3
- VpcEipAssociationNatGateway
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcCidrBlock
- VSwitch1CidrBlock
- VSwitch1ZoneId
- VSwitch2CidrBlock
- VSwitch2ZoneId
- VSwitch3CidrBlock
- VSwitch3ZoneId
- EipBandwidth
- EipInternetChargeType
Label:
default: VPC
- Parameters:
- ContainerCidr
- ServiceCidr
- NumOfNodes
- MasterCount
- MasterInstanceTypes
- MasterSystemDiskCategory
- MasterSystemDiskSize
- WorkerSystemDiskCategory
- WorkerSystemDiskSize
- WorkerInstanceTypes
- SshFlags
- SnatEntry
- KubernetesVersion
- EndpointPublicAccess
- LoginPassword
Label:
default: Kubernetes
TemplateTags:
- acs:solution:容器&微服务:SpringCloud应用托管到ACK服务