ALIYUN::ACS::ApplicationPod类型用于创建应用Pod。
语法
{
"Type": "ALIYUN::ACS::ApplicationPod",
"Properties": {
"CpuCoreNumber": String,
"ComputeClass": String,
"ComputeQos": String,
"Image": String,
"Kind": String,
"Memory": Number,
"DiskConfig": Map,
"GpuModelSeries": String,
"GpuCoreNumber": Number,
"GpuType": String,
"Replicas": Number,
"ZoneId": String
}
}属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
ComputeClass | String | 是 | 是 | 应用Pod的计算类别。 | 可选值:
|
ComputeQos | String | 是 | 是 | 应用Pod的计算QoS(服务质量)。 | 可选值:
|
CpuCoreNumber | String | 是 | 是 | 容器所需的CPU核心数。 | 无 |
Image | String | 是 | 是 | 应用Pod的容器镜像。 | 无 |
Kind | String | 是 | 是 | 应用Pod的种类。 | 可选值:
|
Memory | Number | 是 | 是 | 容器所需的内存大小。 | (单位:GB) |
DiskConfig | Map | 否 | 是 | 应用Pod的磁盘配置。 | 更多信息,请参考DiskConfig属性。 |
GpuCoreNumber | Number | 否 | 是 | 如果使用GPU,则为GPU核心数。 | 无 |
GpuModelSeries | String | 否 | 是 | 如果使用GPU,则为GPU型号系列。 | 无 |
GpuType | String | 否 | 是 | GPU类型。 | 默认为nvidia.com/gpu。 |
Replicas | Number | 否 | 是 | Deployment或StatefulSet的副本数。 | 无 |
ZoneId | String | 否 | 是 | 应用Pod所在的可用区ID。 | 无 |
DiskConfig语法
"DiskConfig": {
"PerformanceLevel": String,
"Size": Number,
"DiskCategory": String
}DiskConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
DiskCategory | String | 是 | 是 | 磁盘类别。 | 例如:cloud_essd。 |
Size | Number | 是 | 是 | 磁盘大小 | 单位:MB。 |
PerformanceLevel | String | 否 | 是 | ESSD磁盘的性能级别。 | 例如:PL2。 |
返回值
Fn::GetAtt
无
示例
场景 1 :创建一个ACS Web应用Pod。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建一个Nginx Web应用Pod,使用Deployment多副本部署。
en: Create an Nginx web application Pod with Deployment for multi-replica deployment.
Parameters:
Replicas:
Type: Number
Label:
zh-cn: 副本数量
en: Replicas
Description:
zh-cn: Web应用的Pod副本数量。
en: Number of Pod replicas for the web application.
Default: 2
MinValue: 1
MaxValue: 50
ZoneId:
Type: String
Label:
zh-cn: 可用区
en: Availability Zone
Description:
zh-cn: 应用Pod所在的可用区ID。
en: The availability zone ID for the application Pod.
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
AssociationPropertyMetadata:
AutoSelectFirst: true
Default: Null
Resources:
WebApp:
Type: ALIYUN::ACS::ApplicationPod
Properties:
Kind: Deployment
Image: nginx:latest
ComputeClass: general-purpose
ComputeQos: default
CpuCoreNumber: '0.25'
Memory: 0.5
Replicas:
Ref: Replicas
ZoneId:
Ref: ZoneId{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建一个Nginx Web应用Pod,使用Deployment多副本部署。",
"en": "Create an Nginx web application Pod with Deployment for multi-replica deployment."
},
"Parameters": {
"Replicas": {
"Type": "Number",
"Label": {
"zh-cn": "副本数量",
"en": "Replicas"
},
"Description": {
"zh-cn": "Web应用的Pod副本数量。",
"en": "Number of Pod replicas for the web application."
},
"Default": 2,
"MinValue": 1,
"MaxValue": 50
},
"ZoneId": {
"Type": "String",
"Label": {
"zh-cn": "可用区",
"en": "Availability Zone"
},
"Description": {
"zh-cn": "应用Pod所在的可用区ID。",
"en": "The availability zone ID for the application Pod."
},
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
"AssociationPropertyMetadata": {
"AutoSelectFirst": true
},
"Default": null
}
},
"Resources": {
"WebApp": {
"Type": "ALIYUN::ACS::ApplicationPod",
"Properties": {
"Kind": "Deployment",
"Image": "nginx:latest",
"ComputeClass": "general-purpose",
"ComputeQos": "default",
"CpuCoreNumber": "0.25",
"Memory": 0.5,
"Replicas": {
"Ref": "Replicas"
},
"ZoneId": {
"Ref": "ZoneId"
}
}
}
}
}场景 2 :创建带持久化存储的有状态应用Pod,配置ESSD云盘实现数据持久化。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建Redis有状态应用Pod,配置ESSD云盘实现数据持久化。
en: Create a Redis StatefulSet Pod with ESSD disk for data persistence.
Parameters:
CpuCoreNumber:
Type: String
Label:
zh-cn: CPU核心数
en: CPU Cores
Description:
zh-cn: 容器所需的CPU核心数。
en: CPU core number required by the container.
Default: '1'
AllowedValues:
- '0.25'
- '0.5'
- '1'
- '2'
- '4'
Memory:
Type: Number
Label:
zh-cn: 内存大小(GB)
en: Memory (GB)
Description:
zh-cn: 容器所需的内存大小,单位为GB。
en: Memory size required by the container, in GB.
Default: 2
AllowedValues:
- 0.5
- 1
- 2
- 4
- 8
Replicas:
Type: Number
Label:
zh-cn: 副本数量
en: Replicas
Description:
zh-cn: Redis StatefulSet的副本数量。
en: Number of replicas for the Redis StatefulSet.
Default: 3
MinValue: 1
MaxValue: 10
DiskSize:
Type: Number
Label:
zh-cn: 数据盘大小(MB)
en: Data Disk Size (MB)
Description:
zh-cn: 数据持久化磁盘大小,单位为MB。
en: Data persistence disk size, in MB.
Default: 20480
MinValue: 10240
MaxValue: 512000
ZoneId:
Type: String
Label:
zh-cn: 可用区
en: Availability Zone
Description:
zh-cn: 应用Pod所在的可用区ID。
en: The availability zone ID for the application Pod.
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
AssociationPropertyMetadata:
AutoSelectFirst: true
Default: Null
Resources:
RedisApp:
Type: ALIYUN::ACS::ApplicationPod
Properties:
Kind: StatefulSet
Image: redis:7-alpine
ComputeClass: performance
ComputeQos: default
CpuCoreNumber:
Ref: CpuCoreNumber
Memory:
Ref: Memory
Replicas:
Ref: Replicas
ZoneId:
Ref: ZoneId
DiskConfig:
DiskCategory: cloud_essd
Size:
Ref: DiskSize
PerformanceLevel: PL1{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建Redis有状态应用Pod,配置ESSD云盘实现数据持久化。",
"en": "Create a Redis StatefulSet Pod with ESSD disk for data persistence."
},
"Parameters": {
"CpuCoreNumber": {
"Type": "String",
"Label": {
"zh-cn": "CPU核心数",
"en": "CPU Cores"
},
"Description": {
"zh-cn": "容器所需的CPU核心数。",
"en": "CPU core number required by the container."
},
"Default": "1",
"AllowedValues": [
"0.25",
"0.5",
"1",
"2",
"4"
]
},
"Memory": {
"Type": "Number",
"Label": {
"zh-cn": "内存大小(GB)",
"en": "Memory (GB)"
},
"Description": {
"zh-cn": "容器所需的内存大小,单位为GB。",
"en": "Memory size required by the container, in GB."
},
"Default": 2,
"AllowedValues": [
0.5,
1,
2,
4,
8
]
},
"Replicas": {
"Type": "Number",
"Label": {
"zh-cn": "副本数量",
"en": "Replicas"
},
"Description": {
"zh-cn": "Redis StatefulSet的副本数量。",
"en": "Number of replicas for the Redis StatefulSet."
},
"Default": 3,
"MinValue": 1,
"MaxValue": 10
},
"DiskSize": {
"Type": "Number",
"Label": {
"zh-cn": "数据盘大小(MB)",
"en": "Data Disk Size (MB)"
},
"Description": {
"zh-cn": "数据持久化磁盘大小,单位为MB。",
"en": "Data persistence disk size, in MB."
},
"Default": 20480,
"MinValue": 10240,
"MaxValue": 512000
},
"ZoneId": {
"Type": "String",
"Label": {
"zh-cn": "可用区",
"en": "Availability Zone"
},
"Description": {
"zh-cn": "应用Pod所在的可用区ID。",
"en": "The availability zone ID for the application Pod."
},
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
"AssociationPropertyMetadata": {
"AutoSelectFirst": true
},
"Default": null
}
},
"Resources": {
"RedisApp": {
"Type": "ALIYUN::ACS::ApplicationPod",
"Properties": {
"Kind": "StatefulSet",
"Image": "redis:7-alpine",
"ComputeClass": "performance",
"ComputeQos": "default",
"CpuCoreNumber": {
"Ref": "CpuCoreNumber"
},
"Memory": {
"Ref": "Memory"
},
"Replicas": {
"Ref": "Replicas"
},
"ZoneId": {
"Ref": "ZoneId"
},
"DiskConfig": {
"DiskCategory": "cloud_essd",
"Size": {
"Ref": "DiskSize"
},
"PerformanceLevel": "PL1"
}
}
}
}
}场景 3 :创建GPU推理任务Pod,使用GPU资源运行AI模型推理任务。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建GPU推理任务Pod,运行一次性AI模型推理任务。
en: Create a GPU inference Job Pod to run a one-time AI model inference task.
Parameters:
Image:
Type: String
Label:
zh-cn: 推理镜像
en: Inference Image
Description:
zh-cn: AI推理任务的容器镜像地址。
en: Container image URL for the AI inference task.
Default: registry-vpc.cn-hangzhou.aliyuncs.com/acs/pytorch-inference:latest
GpuModelSeries:
Type: String
Label:
zh-cn: GPU型号系列
en: GPU Model Series
Description:
zh-cn: GPU型号系列,如T4、V100、A10等。
en: GPU model series, such as T4, V100, A10, etc.
Default: T4
AllowedValues:
- T4
- V100
- A10
- A100
GpuCoreNumber:
Type: Number
Label:
zh-cn: GPU核心数
en: GPU Core Number
Description:
zh-cn: 任务所需的GPU核心数量。
en: Number of GPU cores required by the task.
Default: 1
AllowedValues:
- 1
- 2
- 4
- 8
CpuCoreNumber:
Type: String
Label:
zh-cn: CPU核心数
en: CPU Cores
Description:
zh-cn: 容器所需的CPU核心数。
en: CPU core number required by the container.
Default: '4'
AllowedValues:
- '2'
- '4'
- '8'
- '16'
Memory:
Type: Number
Label:
zh-cn: 内存大小(GB)
en: Memory (GB)
Description:
zh-cn: 容器所需的内存大小,单位为GB。
en: Memory size required by the container, in GB.
Default: 16
AllowedValues:
- 8
- 16
- 32
- 64
DiskSize:
Type: Number
Label:
zh-cn: 数据盘大小(MB)
en: Data Disk Size (MB)
Description:
zh-cn: 用于存储模型文件和推理数据的磁盘大小,单位为MB。
en: Disk size for storing model files and inference data, in MB.
Default: 102400
MinValue: 51200
MaxValue: 1024000
ZoneId:
Type: String
Label:
zh-cn: 可用区
en: Availability Zone
Description:
zh-cn: 应用Pod所在的可用区ID。
en: The availability zone ID for the application Pod.
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
AssociationPropertyMetadata:
AutoSelectFirst: true
Default: Null
Resources:
GpuInferenceJob:
Type: ALIYUN::ACS::ApplicationPod
Properties:
Kind: Job
Image:
Ref: Image
ComputeClass: gpu
ComputeQos: default
CpuCoreNumber:
Ref: CpuCoreNumber
Memory:
Ref: Memory
GpuModelSeries:
Ref: GpuModelSeries
GpuCoreNumber:
Ref: GpuCoreNumber
GpuType: nvidia.com/gpu
ZoneId:
Ref: ZoneId
DiskConfig:
DiskCategory: cloud_essd
Size:
Ref: DiskSize
PerformanceLevel: PL2{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建GPU推理任务Pod,运行一次性AI模型推理任务。",
"en": "Create a GPU inference Job Pod to run a one-time AI model inference task."
},
"Parameters": {
"Image": {
"Type": "String",
"Label": {
"zh-cn": "推理镜像",
"en": "Inference Image"
},
"Description": {
"zh-cn": "AI推理任务的容器镜像地址。",
"en": "Container image URL for the AI inference task."
},
"Default": "registry-vpc.cn-hangzhou.aliyuncs.com/acs/pytorch-inference:latest"
},
"GpuModelSeries": {
"Type": "String",
"Label": {
"zh-cn": "GPU型号系列",
"en": "GPU Model Series"
},
"Description": {
"zh-cn": "GPU型号系列,如T4、V100、A10等。",
"en": "GPU model series, such as T4, V100, A10, etc."
},
"Default": "T4",
"AllowedValues": [
"T4",
"V100",
"A10",
"A100"
]
},
"GpuCoreNumber": {
"Type": "Number",
"Label": {
"zh-cn": "GPU核心数",
"en": "GPU Core Number"
},
"Description": {
"zh-cn": "任务所需的GPU核心数量。",
"en": "Number of GPU cores required by the task."
},
"Default": 1,
"AllowedValues": [
1,
2,
4,
8
]
},
"CpuCoreNumber": {
"Type": "String",
"Label": {
"zh-cn": "CPU核心数",
"en": "CPU Cores"
},
"Description": {
"zh-cn": "容器所需的CPU核心数。",
"en": "CPU core number required by the container."
},
"Default": "4",
"AllowedValues": [
"2",
"4",
"8",
"16"
]
},
"Memory": {
"Type": "Number",
"Label": {
"zh-cn": "内存大小(GB)",
"en": "Memory (GB)"
},
"Description": {
"zh-cn": "容器所需的内存大小,单位为GB。",
"en": "Memory size required by the container, in GB."
},
"Default": 16,
"AllowedValues": [
8,
16,
32,
64
]
},
"DiskSize": {
"Type": "Number",
"Label": {
"zh-cn": "数据盘大小(MB)",
"en": "Data Disk Size (MB)"
},
"Description": {
"zh-cn": "用于存储模型文件和推理数据的磁盘大小,单位为MB。",
"en": "Disk size for storing model files and inference data, in MB."
},
"Default": 102400,
"MinValue": 51200,
"MaxValue": 1024000
},
"ZoneId": {
"Type": "String",
"Label": {
"zh-cn": "可用区",
"en": "Availability Zone"
},
"Description": {
"zh-cn": "应用Pod所在的可用区ID。",
"en": "The availability zone ID for the application Pod."
},
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
"AssociationPropertyMetadata": {
"AutoSelectFirst": true
},
"Default": null
}
},
"Resources": {
"GpuInferenceJob": {
"Type": "ALIYUN::ACS::ApplicationPod",
"Properties": {
"Kind": "Job",
"Image": {
"Ref": "Image"
},
"ComputeClass": "gpu",
"ComputeQos": "default",
"CpuCoreNumber": {
"Ref": "CpuCoreNumber"
},
"Memory": {
"Ref": "Memory"
},
"GpuModelSeries": {
"Ref": "GpuModelSeries"
},
"GpuCoreNumber": {
"Ref": "GpuCoreNumber"
},
"GpuType": "nvidia.com/gpu",
"ZoneId": {
"Ref": "ZoneId"
},
"DiskConfig": {
"DiskCategory": "cloud_essd",
"Size": {
"Ref": "DiskSize"
},
"PerformanceLevel": "PL2"
}
}
}
}
}