forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sae.yml
151 lines (151 loc) · 3.28 KB
/
sae.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
ROSTemplateFormatVersion: '2015-09-01'
Description: SAE Application/Namespace/SlbBinding resource example
Parameters:
ZoneId:
Type: String
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
VpcId:
Type: String
AssociationProperty: ALIYUN::ECS::VPC::VPCId
VSwitchId:
Type: String
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: VpcId
ZoneId: ZoneId
SecurityGroupId:
Type: String
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
VpcId: VpcId
NamespaceName:
Type: String
Description: 命名空间名称
Default: mytest
NamespaceId:
Type: String
Description: 命名空间ID
Default: mytest
Description:
Type: String
Description: 命名空间的描述信息
Default: null
AppName:
Type: String
Description: 应用名称
Default: test
Cpu:
Type: Number
Description: 每个实例所需的CPU。
Default: 1000
Memory:
Type: Number
Description: 每个实例所需的内存
Default: 2048
Replicas:
Type: Number
Description: 初始实例数
Default: 1
PackageType:
Type: String
Description: 应用包类型
Default: Image
ImageUrl:
Type: String
Description: 镜像地址
Default: registry-vpc.cn-hangzhou.aliyuncs.com/sae-demo-image/consumer:1.0
CommandArgs:
Type: String
Description: 镜像启动命令参数
Default: null
Envs:
Type: String
Description: 容器环境变量参数
Default: null
Timezone:
Type: String
Description: 时区
Default: Asia/Shanghai
LoadBalancerSpec:
Type: String
Description: 负载均衡实例的规格
Default: slb.s2.medium
Resources:
LoadBalancer:
Type: ALIYUN::SLB::LoadBalancer
Properties:
MasterZoneId:
Ref: ZoneId
LoadBalancerSpec:
Ref: LoadBalancerSpec
Namespace:
Type: ALIYUN::SAE::Namespace
Properties:
NamespaceName:
Ref: NamespaceName
NamespaceId:
Fn::Sub: ${ALIYUN::Region}:${NamespaceId}
NamespaceDescription:
Ref: Description
DependsOn: LoadBalancer
SaeApp:
Type: ALIYUN::SAE::Application
Properties:
VpcId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
SecurityGroupId:
Ref: SecurityGroupId
AppName:
Ref: AppName
NamespaceId:
Fn::GetAtt:
- Namespace
- NamespaceId
Cpu:
Ref: Cpu
Memory:
Ref: Memory
Replicas:
Ref: Replicas
PackageType:
Ref: PackageType
Deploy: true
ImageUrl:
Ref: ImageUrl
CommandArgs:
Ref: CommandArgs
Envs:
Ref: Envs
Timezone:
Ref: Timezone
DependsOn:
- Namespace
BindSlb:
Type: ALIYUN::SAE::SlbBinding
Properties:
AppId:
Ref: SaeApp
Intranet: '[{"port": 80, "targetPort": 8080, "protocol": "TCP"}]'
InternetSlbId:
Ref: LoadBalancer
DependsOn:
- LoadBalancer
- SaeApp
Outputs:
AppId:
Value:
Fn::GetAtt:
- SaeApp
- AppId
ChangeOrderId:
Value:
Fn::GetAtt:
- SaeApp
- ChangeOrderId
NamespaceId:
Value:
Fn::GetAtt:
- Namespace
- NamespaceId