ALIYUN::ACS::ApplicationPod

Updated at:

The ALIYUN::ACS::ApplicationPod resource type is used to create application Pods.

Syntax

{
  "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
  }
}

Properties

Property

Type

Required

Editable

Description

Constraints

ComputeClass

String

Yes

Yes

The compute class of the application Pod.

Valid values:

  • general-purpose:common workloads.

  • performance: compute-optimized.

  • gpu: for workloads that need GPU resources.

ComputeQos

String

Yes

Yes

The compute QoS (quality of service) of the application Pod.

Valid values:

  • default

  • best-effort

Default value: default.

CpuCoreNumber

String

Yes

Yes

The number of CPU cores required by the container.

None.

Image

String

Yes

Yes

The container image of the application Pod.

None.

Kind

String

Yes

Yes

The workload type that the application Pod runs as.

Valid values:

  • Job

  • CronJob

  • Deployment

  • StatefulSet

Memory

Number

Yes

Yes

The memory size required by the container.

Unit: GB.

DiskConfig

Map

No

Yes

The disk configuration of the application Pod.

For more information, see DiskConfig properties.

GpuCoreNumber

Number

No

Yes

If GPU is used, the number of GPU cores.

None.

GpuModelSeries

String

No

Yes

If GPU is used, the GPU model series.

None.

GpuType

String

No

Yes

If GPU is used, the GPU type.

Default value: nvidia.com/gpu.

Replicas

Number

No

Yes

The number of replicas for the Deployment and StatefulSet.

None.

ZoneId

String

No

Yes

The ID of the availability zone in which the application Pod is deployed.

None.

DiskConfig syntax

"DiskConfig": {
  "PerformanceLevel": String,
  "Size": Number,
  "DiskCategory": String
}

DiskConfig properties

Property

Type

Required

Editable

Description

Constraints

DiskCategory

String

Yes

Yes

The category of the disk configured for the application Pod.

Example: cloud_essd.

Size

Number

Yes

Yes

The size of the disk configured for the application Pod.

Unit: MB.

PerformanceLevel

String

No

Yes

The performance level (PL) of the ESSD disk.

Example: PL2.

Return values

Fn::GetAtt

None.

Examples

Scenario 1: Create an ACS web application Pod as a Deployment that uses the general-purpose compute class.

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: Create an Nginx web application Pod with Deployment for multi-replica deployment.
  en: Create an Nginx web application Pod with Deployment for multi-replica deployment.
Parameters:
  Replicas:
    Type: Number
    Label:
      zh-cn: Replicas
      en: Replicas
    Description:
      zh-cn: Number of Pod replicas for the web application.
      en: Number of Pod replicas for the web application.
    Default: 2
    MinValue: 1
    MaxValue: 50
  ZoneId:
    Type: String
    Label:
      zh-cn: Availability Zone
      en: Availability Zone
    Description:
      zh-cn: The availability zone ID for the application Pod.
      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": "Create an Nginx web application Pod with Deployment for multi-replica deployment.",
    "en": "Create an Nginx web application Pod with Deployment for multi-replica deployment."
  },
  "Parameters": {
    "Replicas": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Replicas",
        "en": "Replicas"
      },
      "Description": {
        "zh-cn": "Number of Pod replicas for the web application.",
        "en": "Number of Pod replicas for the web application."
      },
      "Default": 2,
      "MinValue": 1,
      "MaxValue": 50
    },
    "ZoneId": {
      "Type": "String",
      "Label": {
        "zh-cn": "Availability Zone",
        "en": "Availability Zone"
      },
      "Description": {
        "zh-cn": "The availability zone ID for the application Pod.",
        "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"
        }
      }
    }
  }
}

Scenario 2: Create a stateful application Pod as a StatefulSet that uses the performance compute class and an ESSD disk for data persistence.

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: Create a Redis StatefulSet Pod with ESSD disk for data persistence.
  en: Create a Redis StatefulSet Pod with ESSD disk for data persistence.
Parameters:
  CpuCoreNumber:
    Type: String
    Label:
      zh-cn: CPU Cores
      en: CPU Cores
    Description:
      zh-cn: CPU core number required by the container.
      en: CPU core number required by the container.
    Default: '1'
    AllowedValues:
      - '0.25'
      - '0.5'
      - '1'
      - '2'
      - '4'
  Memory:
    Type: Number
    Label:
      zh-cn: Memory (GB)
      en: Memory (GB)
    Description:
      zh-cn: Memory size required by the container, in 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: Replicas
      en: Replicas
    Description:
      zh-cn: Number of replicas for the Redis StatefulSet.
      en: Number of replicas for the Redis StatefulSet.
    Default: 3
    MinValue: 1
    MaxValue: 10
  DiskSize:
    Type: Number
    Label:
      zh-cn: Data Disk Size (MB)
      en: Data Disk Size (MB)
    Description:
      zh-cn: Data persistence disk size, in MB.
      en: Data persistence disk size, in MB.
    Default: 20480
    MinValue: 10240
    MaxValue: 512000
  ZoneId:
    Type: String
    Label:
      zh-cn: Availability Zone
      en: Availability Zone
    Description:
      zh-cn: The availability zone ID for the application Pod.
      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": "Create a Redis StatefulSet Pod with ESSD disk for data persistence.",
    "en": "Create a Redis StatefulSet Pod with ESSD disk for data persistence."
  },
  "Parameters": {
    "CpuCoreNumber": {
      "Type": "String",
      "Label": {
        "zh-cn": "CPU Cores",
        "en": "CPU Cores"
      },
      "Description": {
        "zh-cn": "CPU core number required by the container.",
        "en": "CPU core number required by the container."
      },
      "Default": "1",
      "AllowedValues": [
        "0.25",
        "0.5",
        "1",
        "2",
        "4"
      ]
    },
    "Memory": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Memory (GB)",
        "en": "Memory (GB)"
      },
      "Description": {
        "zh-cn": "Memory size required by the container, in 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": "Replicas",
        "en": "Replicas"
      },
      "Description": {
        "zh-cn": "Number of replicas for the Redis StatefulSet.",
        "en": "Number of replicas for the Redis StatefulSet."
      },
      "Default": 3,
      "MinValue": 1,
      "MaxValue": 10
    },
    "DiskSize": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Data Disk Size (MB)",
        "en": "Data Disk Size (MB)"
      },
      "Description": {
        "zh-cn": "Data persistence disk size, in MB.",
        "en": "Data persistence disk size, in MB."
      },
      "Default": 20480,
      "MinValue": 10240,
      "MaxValue": 512000
    },
    "ZoneId": {
      "Type": "String",
      "Label": {
        "zh-cn": "Availability Zone",
        "en": "Availability Zone"
      },
      "Description": {
        "zh-cn": "The availability zone ID for the application Pod.",
        "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"
        }
      }
    }
  }
}

Scenario 3: Create an AI inference application Pod as a Job that uses GPU resources.

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: Create a GPU inference Job Pod to run a one-time AI model inference task.
  en: Create a GPU inference Job Pod to run a one-time AI model inference task.
Parameters:
  Image:
    Type: String
    Label:
      zh-cn: Inference Image
      en: Inference Image
    Description:
      zh-cn: Container image URL for the AI inference task.
      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 Model Series
      en: GPU Model Series
    Description:
      zh-cn: GPU model series, such as T4, V100, A10, etc.
      en: GPU model series, such as T4, V100, A10, etc.
    Default: T4
    AllowedValues:
      - T4
      - V100
      - A10
      - A100
  GpuCoreNumber:
    Type: Number
    Label:
      zh-cn: GPU Core Number
      en: GPU Core Number
    Description:
      zh-cn: Number of GPU cores required by the task.
      en: Number of GPU cores required by the task.
    Default: 1
    AllowedValues:
      - 1
      - 2
      - 4
      - 8
  CpuCoreNumber:
    Type: String
    Label:
      zh-cn: CPU Cores
      en: CPU Cores
    Description:
      zh-cn: CPU core number required by the container.
      en: CPU core number required by the container.
    Default: '4'
    AllowedValues:
      - '2'
      - '4'
      - '8'
      - '16'
  Memory:
    Type: Number
    Label:
      zh-cn: Memory (GB)
      en: Memory (GB)
    Description:
      zh-cn: Memory size required by the container, in GB.
      en: Memory size required by the container, in GB.
    Default: 16
    AllowedValues:
      - 8
      - 16
      - 32
      - 64
  DiskSize:
    Type: Number
    Label:
      zh-cn: Data Disk Size (MB)
      en: Data Disk Size (MB)
    Description:
      zh-cn: Disk size for storing model files and inference data, in 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: Availability Zone
      en: Availability Zone
    Description:
      zh-cn: The availability zone ID for the application Pod.
      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": "Create a GPU inference Job Pod to run a one-time AI model inference task.",
    "en": "Create a GPU inference Job Pod to run a one-time AI model inference task."
  },
  "Parameters": {
    "Image": {
      "Type": "String",
      "Label": {
        "zh-cn": "Inference Image",
        "en": "Inference Image"
      },
      "Description": {
        "zh-cn": "Container image URL for the AI inference task.",
        "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 Model Series",
        "en": "GPU Model Series"
      },
      "Description": {
        "zh-cn": "GPU model series, such as T4, V100, A10, etc.",
        "en": "GPU model series, such as T4, V100, A10, etc."
      },
      "Default": "T4",
      "AllowedValues": [
        "T4",
        "V100",
        "A10",
        "A100"
      ]
    },
    "GpuCoreNumber": {
      "Type": "Number",
      "Label": {
        "zh-cn": "GPU Core Number",
        "en": "GPU Core Number"
      },
      "Description": {
        "zh-cn": "Number of GPU cores required by the task.",
        "en": "Number of GPU cores required by the task."
      },
      "Default": 1,
      "AllowedValues": [
        1,
        2,
        4,
        8
      ]
    },
    "CpuCoreNumber": {
      "Type": "String",
      "Label": {
        "zh-cn": "CPU Cores",
        "en": "CPU Cores"
      },
      "Description": {
        "zh-cn": "CPU core number required by the container.",
        "en": "CPU core number required by the container."
      },
      "Default": "4",
      "AllowedValues": [
        "2",
        "4",
        "8",
        "16"
      ]
    },
    "Memory": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Memory (GB)",
        "en": "Memory (GB)"
      },
      "Description": {
        "zh-cn": "Memory size required by the container, in GB.",
        "en": "Memory size required by the container, in GB."
      },
      "Default": 16,
      "AllowedValues": [
        8,
        16,
        32,
        64
      ]
    },
    "DiskSize": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Data Disk Size (MB)",
        "en": "Data Disk Size (MB)"
      },
      "Description": {
        "zh-cn": "Disk size for storing model files and inference data, in 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": "Availability Zone",
        "en": "Availability Zone"
      },
      "Description": {
        "zh-cn": "The availability zone ID for the application Pod.",
        "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"
        }
      }
    }
  }
}