O recurso ALIYUN::ACS::ApplicationPod cria Pods de aplicação.
Sintaxe
{
"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
}
}
Propriedades
Propriedade | Tipo | Obrigatória | Editável | Descrição | Restrições |
ComputeClass | String | Sim | Sim | Classe de computação do Pod de aplicação. | Valores válidos:
|
ComputeQos | String | Sim | Sim | QoS (qualidade de service) de computação do Pod de aplicação. | Valores válidos:
|
CpuCoreNumber | String | Sim | Sim | Número de núcleos de CPU exigidos pelo contêiner. | Nenhuma |
Image | String | Sim | Sim | Imagem de contêiner do Pod de aplicação. | Nenhuma |
Kind | String | Sim | Sim | Tipo do Pod de aplicação. | Valores válidos:
|
Memory | Number | Sim | Sim | Tamanho de memória exigido pelo contêiner. | Unidade: GB |
DiskConfig | Map | Não | Sim | Configuração de disco do Pod de aplicação. | Para mais informações, consulte Propriedades de DiskConfig. |
GpuCoreNumber | Number | Não | Sim | Número de núcleos de GPU, se houver uso de GPU. | Nenhuma |
GpuModelSeries | String | Não | Sim | Série do modelo de GPU, se aplicável. | Nenhuma |
GpuType | String | Não | Sim | Tipo da GPU. | Valor padrão: nvidia.com/gpu |
Replicas | Number | Não | Sim | Número de réplicas para Deployment ou StatefulSet. | Nenhuma |
ZoneId | String | Não | Sim | ID da zona de disponibilidade onde o Pod de aplicação reside. | Nenhuma |
Sintaxe de DiskConfig
"DiskConfig": {
"PerformanceLevel": String,
"Size": Number,
"DiskCategory": String
}
Propriedades de DiskConfig
|
Propriedade |
Tipo |
Obrigatória |
Editável |
Descrição |
Restrições |
|
DiskCategory |
String |
Sim |
Sim |
Categoria do disco. |
Exemplo: cloud_essd. |
|
Size |
Number |
Sim |
Sim |
Tamanho do disco. |
Unidade: MB. |
|
PerformanceLevel |
String |
Não |
Sim |
Nível de desempenho do disco ESSD. |
Exemplo: PL2. |
Valores de retorno
Fn::GetAtt
Nenhum
Exemplos
Cenário 1: Crie um Pod de aplicação web ACS.
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"
}
}
}
}
}Cenário 2: Crie um Pod de aplicação com estado e armazenamento persistente usando disco ESSD para persistência de dados.
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"
}
}
}
}
}Cenário 3: Crie um Pod de Job de inferência com GPU para executar tarefas de inferência de modelos de IA com recursos de GPU.
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"
}
}
}
}
}