Creates a scaling configuration of the Elastic Container Instance type. Auto Scaling uses the scaling configuration as a template to create elastic container instances to meet your business requirements during scale-outs.
Operation description
A scaling configuration is a template that is used to create elastic container instances during scale-out activities.
You can specify the Cpu and Memory parameters to determine the range of instance types. If you specify the parameters, Auto Scaling determines the available instance types based on factors such as I/O optimization requirements and zones. Auto Scaling preferentially creates elastic container instances of the instance type that is provided at the lowest price. This scaling mode is available only if Scaling Policy is set to Cost Optimization Policy and no instance type is specified in the scaling configuration.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ScalingGroupId | string | Yes | The ID of the scaling group in which you want to create the scaling configuration. | asg-bp14wlu85wrpchm0**** |
ScalingConfigurationName | string | Yes | The name of the scaling configuration. The name must be 2 to 64 characters in length, and can contain letters, digits, underscores (_), hyphens (-), and periods (.). The name must start with a letter or a digit. The name of the scaling configuration must be unique within a scaling group in a region. If you do not specify this parameter, the value of the ScalingConfigurationId parameter is used. | scalingconfig**** |
Description | string | Yes | Note
This parameter is unavailable.
| desc |
SecurityGroupId | string | Yes | The ID of the security group with which you want to associate the elastic container instance. Elastic container instances that are associated with the same security group can access each other. If you do not specify a security group, the system uses the default security group in the region that you selected. Make sure that the inbound rules of the security group contain the protocols and the port numbers of the containers that you want to expose. If you do not have a default security group in the region, the system creates a default security group, and then adds the declared container protocols and port numbers to the inbound rules of the security group. | sg-uf66jeqopgqa9hdn**** |
ContainerGroupName | string | Yes | The name of the elastic container instance. | nginx-test |
RestartPolicy | string | No | The restart policy of the elastic container instance. Valid values:
Default value: Always. | Always |
Cpu | float | No | The number of vCPUs of the elastic container instance. | 1.0 |
Memory | float | No | The memory size of the elastic container instance. Unit: GiB. | 2.0 |
ResourceGroupId | string | No | The ID of the resource group. | rg-uf66jeqopgqa9hdn**** |
DnsPolicy | string | No | The Domain Name System (DNS) policy. Valid values:
| Default |
EnableSls | boolean | No | Note
This parameter is unavailable.
| false |
ImageSnapshotId | string | No | The ID of the image cache. | imc-2zebxkiifuyzzlhl**** |
RamRoleName | string | No | The name of the RAM role for the elastic container instance. You can use an instance RAM role to access both elastic container instances and Elastic Compute Service (ECS) instances. For more information, see Use an instance RAM role by calling API operations. | RamTestRole |
TerminationGracePeriodSeconds | long | No | The buffer time in which the program handles operations before the program is stopped. Unit: seconds. | 60 |
AutoMatchImageCache | boolean | No | Specifies whether to automatically match the image cache. Valid values:
Default value: false. | false |
Ipv6AddressCount | integer | No | The number of IPv6 addresses. | 1 |
ActiveDeadlineSeconds | long | No | The validity period. Unit: seconds. | 1000 |
SpotStrategy | string | No | The bidding policy for the elastic container instance. Valid values:
Default value: NoSpot. | SpotPriceLimit |
SpotPriceLimit | float | No | The maximum hourly price of the preemptible elastic container instance. The value can be accurate to three decimal places. If you set the SpotStrategy parameter to SpotWithPriceLimit, you must also specify the SpotPriceLimit parameter. | 0.025 |
AutoCreateEip | boolean | No | Specifies whether to automatically create an elastic IP address (EIP) and bind the EIP to the elastic container instance. | true |
EipBandwidth | integer | No | The bandwidth of the EIP. Default value: 5 Mbit/s. | 5 |
HostName | string | No | The name of the elastic container instance. | test |
IngressBandwidth | long | No | The maximum inbound bandwidth. Unit: bit/s. | 1024000 |
EgressBandwidth | long | No | The maximum outbound bandwidth. Unit: bytes. | 1024000 |
CpuOptionsCore | integer | No | Number of physical CPU cores This parameter is not available for all instance types. For more information, see Specify custom CPU options. | 2 |
CpuOptionsThreadsPerCore | integer | No | The number of threads per core. This parameter is not available for all instance types. A value of 1 indicates that Hyper-Threading is disabled. For more information, see Specify custom CPU options. | 2 |
EphemeralStorage | integer | No | The size of the temporary storage space. By default, an ESSD of the PL1 type is used. Unit: GiB. | 20 |
LoadBalancerWeight | integer | No | The weight of the elastic container instance as a backend server. Valid values: 1 to 100. Default value: 50. | 50 |
Tags | object [] | No | The tags of the elastic container instance. The tags must be specified in the key-value pair format. You can specify up to 20 tags. When you specify tag keys and tag values, take note of the following items:
| |
Key | string | No | The tag key of the elastic container instance. You can specify 1 to 20 tags. You cannot specify an empty string as a tag key. The tag key can be up to 128 characters in length and cannot start with | version |
Value | string | No | The tag value of the elastic container instance. You can specify 1 to 20 tags. You can specify an empty string as a tag value. The tag value can be up to 128 characters in length and cannot start with | 3 |
ImageRegistryCredentials | object [] | No | Information about the image repository. | |
Password | string | No | The password that is used to access the image repository. | yourpaasword |
Server | string | No | The domain name of the image repository. | registry-vpc.cn-shanghai.aliyuncs.com |
UserName | string | No | The username that is used to access the image repository. | yourusername |
Containers | object [] | No | The containers in the elastic container instance. | |
ReadinessProbe.TimeoutSeconds | integer | No | The timeout period for the readiness probe. Unit: seconds. Default value: 1. Minimum value: 1. | 5 |
ReadinessProbe.SuccessThreshold | integer | No | The minimum number of consecutive successes before a failed readiness probe is considered successful. Default value: 1. Set the value to 1. | 1 |
SecurityContext.Capability.Add | array | No | The permissions that you want to grant to the processes in the container. Valid values: NET_ADMIN and NET_RAW. Note
To use NET_RAW, you must submit a ticket.
| |
string | No | The permissions that you want to grant to the process in the container. Valid values: NET_ADMIN and NET_RAW. Note
To use NET_RAW, you must submit a ticket.
| NET_ADMIN | |
ReadinessProbe.TcpSocket.Port | integer | No | The port detected by TCP sockets when you use the TCP sockets to perform readiness probes. | 8000 |
ReadinessProbe.HttpGet.Scheme | string | No | The protocol type of HTTP GET requests when you use the HTTP requests to perform readiness probes. Valid values:
| HTTP |
LivenessProbe.PeriodSeconds | integer | No | The interval at which liveness probes are performed. Unit: seconds. Default value: 10. Minimum value: 1. | 5 |
Ports | object [] | No | The ports. | |
Protocol | string | No | The protocol type. Valid values:
| TCP |
Port | integer | No | The port number. Valid values: 1 to 65535. | 80 |
SecurityContext.ReadOnlyRootFilesystem | boolean | No | Specifies whether the root file system on which the container runs is read-only. | true |
EnvironmentVars | object [] | No | The environment variables. | |
Key | string | No | The name of the environment variable. The name can be 1 to 128 characters in length and can contain underscores (_) and digits. The name cannot start with a digit. Specify the value in the [0-9a-zA-Z] format. | PATH |
Value | string | No | The value of the environment variable. The value can be up to 256 characters in length. | /usr/local/bin |
FieldRefFieldPath | string | No | Note
This parameter is not available for use.
| fieldPath |
LivenessProbe.TcpSocket.Port | integer | No | The port detected by TCP sockets when you use the TCP sockets to perform liveness probes. | 8000 |
Tty | boolean | No | Specifies whether to enable interaction. Valid values:
If the command is a /bin/bash command, set the value to true. Default value: false. | false |
WorkingDir | string | No | The working directory of the container. | /usr/local/ |
LivenessProbe.HttpGet.Scheme | string | No | The protocol type of HTTP GET requests when you use the HTTP requests to perform liveness probes. Valid values:
| HTTP |
ReadinessProbe.HttpGet.Port | integer | No | The port to which HTTP GET requests are sent when you use the HTTP requests to perform readiness probes. | 8080 |
Args | array | No | The container startup arguments. You can specify up to 10 arguments. | |
string | No | The container startup argument. You can specify up to 10 arguments. | 100 | |
Gpu | integer | No | The number of GPUs that you want to allocate to the container. | 1 |
ReadinessProbe.InitialDelaySeconds | integer | No | The number of seconds that elapse from the startup of the container to the start time of a readiness probe. Unit: seconds. | 3 |
Stdin | boolean | No | Specifies whether the container allocates buffer resources to standard input streams when the container is running. If you do not specify this parameter, an end-of-file (EOF) error may occur when standard input streams in the container are read. Default value: false. | false |
Memory | float | No | The memory size that you want to allocate to the container. Unit: GiB. | 0.5 |
Name | string | No | The name of the container image. | nginx |
Image | string | No | The image of the container. | registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:latest |
LivenessProbe.InitialDelaySeconds | integer | No | The number of seconds that elapses from the startup of the container to the start time of a liveness probe. Unit: seconds. | 5 |
VolumeMounts | object [] | No | The volume mounts of the container. | |
MountPropagation | string | No | The mount propagation setting of the volume. Mount propagation allows volumes that are mounted on one container to be shared with other containers in the same pod, or even with other pods on the same node. Valid values:
Default value: None. | None |
MountPath | string | No | The directory to which the container mounts the volume. Note
Data under this directory is overwritten by data on the volume. Specify this parameter with caution.
| /pod/data |
ReadOnly | boolean | No | Specifies whether the volume is read-only. Valid values:
Default value: false. | false |
Name | string | No | The volume name. The value of this parameter is the same as the value of Volumes.Name. | default-volume1 |
SubPath | string | No | The subdirectory of the volume. | data2/ |
LivenessProbe.FailureThreshold | integer | No | The minimum number of consecutive failures before a successful liveness probe is considered failed. Default value: 3. | 3 |
ReadinessProbe.Exec.Commands | array | No | The commands executed in the container when using the command line to perform the health check. | |
string | No | The command. | cat /tmp/healthy | |
ReadinessProbe.FailureThreshold | integer | No | The minimum number of consecutive failures before a successful readiness probe is considered failed. Default value: 3. | 3 |
ImagePullPolicy | string | No | The image pulling policy. Valid values:
| Always |
StdinOnce | boolean | No | Specifies whether to remain standard input streams connected during multiple sessions if StdinOnce is set to true. If StdinOnce is set to true, standard input streams are connected after the container is started, and remain idle until a client is connected to receive data. After the client is disconnected, streams are also disconnected, and remain disconnected until the container is restarted. | false |
Cpu | float | No | The number of vCPUs that you want to allocate to the container. | 0.25 |
LivenessProbe.HttpGet.Port | integer | No | The port to which HTTP GET requests are sent when you use the HTTP requests to perform liveness probes. | 8888 |
LivenessProbe.HttpGet.Path | string | No | The path to which HTTP GET requests are sent when you use the HTTP requests to perform liveness probes. | /healthyz |
LivenessProbe.SuccessThreshold | integer | No | The minimum number of consecutive successes before a failed liveness probe is considered successful. Default value: 1. Set the value to 1. | 1 |
ReadinessProbe.PeriodSeconds | integer | No | The interval at which readiness probes are performed. Unit: seconds. Default value: 10. Minimum value: 1. | 3 |
LivenessProbe.TimeoutSeconds | integer | No | The timeout period for the liveness probe. Unit: seconds. Default value: 1. Minimum value: 1. | 1 |
Commands | array | No | The commands that you can run in the container when you use the CLI to perform liveness probes. | |
string | No | The command that you can run in the container when you use the CLI to perform liveness probes. | sleep | |
SecurityContext.RunAsUser | long | No | The ID of the user that runs the container. | 1000 |
ReadinessProbe.HttpGet.Path | string | No | The path to which HTTP GET requests are sent when you use the HTTP requests to perform readiness probes. | /healthz |
LivenessProbe.Exec.Commands | array | No | The commands executed in the container when using the command line to perform the health check. | |
string | No | The command. | cat /tmp/healthy | |
Volumes | object [] | No | Information about the volumes. | |
Type | string | No | The type of the Host file or path. Examples: File, Directory, and Socket. | ConfigFileVolume |
DiskVolume.DiskSize | integer | No | The storage size of the disk volume. Unit: GiB. | 15 |
NFSVolume.Path | string | No | The path of the NFS volume. | /share |
FlexVolume.FsType | string | No | The type of the mounted file system. By default, the value of this parameter varies based on the script of FlexVolume. | ext4 |
DiskVolume.FsType | string | No | The type of the disk volume. We recommend that you specify the | xfs |
HostPathVolume.Type | string | No | The type of host directory. For example: File, Directory, Socket, etc. | Directory |
NFSVolume.ReadOnly | boolean | No | Specifies whether the NFS volume is read-only. Valid values:
Default value: false. | false |
HostPathVolume.Path | string | No | The absolute path to the Host node. | /xx/xx/path |
FlexVolume.Options | string | No | The FlexVolume objects. Each object is a key-value pair contained in a JSON string. If you set the Type parameter to FlexVolume, specify objects in the | {"volumeId":"d-2zehdahrwoa7srg****","performanceLevel": "PL2"} |
FlexVolume.Driver | string | No | The name of the FlexVolume driver. | flexvolume |
ConfigFileVolumeDefaultMode | integer | No | The default permissions on the ConfigFile volume. | 0644 |
NFSVolume.Server | string | No | The endpoint of the NFS server. | 3f9cd4a596-naw76.cn-shanghai.nas.aliyuncs.com |
DiskVolume.DiskId | string | No | The ID of the disk volume. | d-xx |
Name | string | No | The name of the volume. | default-volume1 |
EmptyDirVolume.Medium | string | No | The storage medium when you set the Type parameter to EmptyDirVolume. If you leave this parameter empty, the file system that backs the node is used as the storage medium. If you set this parameter to memory, the memory is used as the storage medium. | memory |
ConfigFileVolumeConfigFileToPaths | object [] | No | The paths to the configuration files. | |
Path | string | No | The name of the environment variable. The name must be 1 to 128 characters in length. Specify the name in the | PATH |
Mode | integer | No | The permissions on ConfigFileVolume. | 0644 |
Content | string | No | The content of the configuration file, which can be up to 32 KB in size. | bGl1bWk= |
InitContainers | object [] | No | The init containers. | |
InitContainerEnvironmentVars | object [] | No | The environment variables of the init container. | |
Key | string | No | The key of the environment variable. Specify the key in the | Path |
Value | string | No | The value of the environment variable. The value must be 0 to 256 characters in length. | /usr/bin/ |
FieldRefFieldPath | string | No | Note
This parameter is unavailable.
| path |
SecurityContext.Capability.Adds | array | No | The permissions granted to processes in the container. | |
string | No | The permission granted to processes in the container. Valid values: NET_ADMIN and NET_RAW. Note
To use NET_RAW, you must submit a ticket.
| NET_ADMIN | |
Image | string | No | The container image. | nginx |
InitContainerPorts | object [] | No | The ports of the init container. | |
Protocol | string | No | The type of the protocol. Valid values:
| TCP |
Port | integer | No | The port number. Valid values: 1 to 65535. | 1 |
InitContainerVolumeMounts | object [] | No | Information about the volume mounts of the init container. | |
MountPropagation | string | No | The mount propagation settings of the volume . Mount propagation allows volumes that are mounted on one container to be shared with other containers in the same pod, or even with other pods on the same node. Valid values:
| None |
MountPath | string | No | The path to which the volume is mounted. Data under this path is overwritten by the data on the volume. | /usr/share/ |
ReadOnly | boolean | No | Specifies whether the mount path is read-only. Default value: false. | false |
Name | string | No | The name of the volume. | test-empty |
SubPath | string | No | The subdirectory of the volume. The elastic container instance can mount different directories of the same volume to different subdirectories of containers. | /usr/sub/ |
SecurityContext.ReadOnlyRootFilesystem | boolean | No | Specifies whether the root file system is read-only. Set the value to true. | true |
ImagePullPolicy | string | No | The image pulling policy. | Always |
Cpu | float | No | The number of vCPUs that you want to allocate to the container. | 0.5 |
WorkingDir | string | No | The working directory. | /usr/local |
Commands | array | No | The list of commands that you want to run to start the container. | |
string | No | The command. | sleep | |
Args | array | No | The arguments that correspond to the startup commands of the container. You can specify up to 10 arguments. | |
string | No | The arguments that correspond to the startup commands of the container. You can specify up to 10 arguments. | 100 | |
SecurityContext.RunAsUser | long | No | The ID of the user that runs the container. | 587 |
Gpu | integer | No | The number of GPUs that you want to allocate to the container. | 1 |
Memory | float | No | The size of the memory. Unit: GiB. | 1.0 |
Name | string | No | The name of the container. | test-init |
DnsConfigNameServers | array | No | The IP addresses of the DNS servers. | |
string | No | The IP addresses of the DNS servers. | 172.10.*.** | |
DnsConfigSearchs | array | No | The DNS lookup domains. | |
string | No | The DNS lookup domains. | svc.local.kubenetes | |
DnsConfigOptions | object [] | No | The options. Each option is in the name-value pair format. The value in the name-value pair is optional. | |
Value | string | No | The variable value of the option. | value |
Name | string | No | The variable name of the option. | name |
HostAliases | object [] | No | The hostnames and IP addresses of a container that you want to add to the hosts file of the elastic container instance. | |
Ip | string | No | The IP address that you want to add. | 1.1.1.1 |
Hostnames | array | No | The hostname that you want to add. | |
string | No | The hostname that you want to add. | hehe.com | |
SecurityContextSysctls | object [] | No | The system information of the security context in which the elastic container instance runs. | |
Value | string | No | The variable value of the security context in which the elastic container instance runs. | 65536 |
Name | string | No | The variable name of the security context in which the elastic container instance runs. | kernel.msgmax |
NtpServers | array | No | The domain name of the Network Time Protocol (NTP) server. | |
string | No | The domain name of the NTP server. | ntp.cloud.aliyuncs.com | |
AcrRegistryInfos | object [] | No | Information about the Container Registry Enterprise Edition instance. | |
Domains | array | No | The domain names of the Container Registry Enterprise Edition instances. By default, all domain names of the Container Registry Enterprise Edition instances are displayed. You can specify one or more domain names. Separate multiple domain names with commas (,). | |
string | No | The domain names of the Container Registry Enterprise Edition instances. By default, all domain names of the Container Registry Enterprise Edition instances are displayed. You can specify one or more domain names. Separate multiple domain names with commas (,). | *****-****-registry.cn-beijing.cr.aliyuncs.com | |
InstanceName | string | No | The name of the Container Registry Enterprise Edition instance. | acr-test |
InstanceId | string | No | The ID of the Container Registry Enterprise Edition instance. | cri-nwj395hgf6f3**** |
RegionId | string | No | The region ID of the Container Registry Enterprise Edition instance. | cn-beijing |
CostOptimization | boolean | No | Specifies whether to enable the cost optimization feature. Valid values:
| false |
InstanceFamilyLevel | string | No | The level of the instance type, which is used to filter the instance types that meet the specified criteria. This parameter takes effect only if you set the
| EnterpriseLevel |
DataCacheBucket | string | No | The bucket that caches data. | default |
DataCachePL | string | No | The performance level (PL) of the cloud disk that caches disk. We recommend that you use enhanced SSDs (ESSDs). Valid values:
Default value: PL1. Note
For more information about ESSDs, see ESSDs .
| PL1 |
DataCacheProvisionedIops | integer | No | The provisioned read/write IOPS of the ESSD AutoPL disk that caches data. Valid values: 0 to min{50,000, 1,000 × *Capacity - Baseline IOPS}. Baseline IOPS = min{1,800+50 x *Capacity, 50,000}. Note
For more information about ESSD AutoPL disks, see ESSD AutoPL disks.
| 40000 |
DataCacheBurstingEnabled | boolean | No | Specifies whether to enable the Performance Burst feature for the ESSD AutoPL disk that caches data. Valid values:
Default value: false. Note
For more information about ESSD AutoPL disks, see ESSD AutoPL disks.
| false |
Response parameters
Examples
Sample success responses
JSON
format
{
"ScalingConfigurationId": "eci-uf6fonnghi50u374****",
"RequestId": "89945DD3-9072-47D0-A318-353284CF****"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
403 | Forbidden.RiskControl | Forbidden.RiskControl |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2024-01-23 | The Error code has changed | see changesets | ||||||||||||||
| ||||||||||||||||
2023-11-14 | The Error code has changed. The request parameters of the API has changed | see changesets | ||||||||||||||
| ||||||||||||||||
2023-10-11 | The Error code has changed. The request parameters of the API has changed | see changesets | ||||||||||||||
| ||||||||||||||||
2023-07-12 | The Error code has changed | see changesets | ||||||||||||||
|