Deploys an application in a Container Service for Kubernetes (ACK) cluster or a serverless Kubernetes cluster.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
edas:ManageApplication |
|
| none |
Request syntax
POST /pop/v5/k8s/acs/k8s_apps HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
PreStop | string | No | The pre-stop script. Example: | {\"exec\":{\"command\":[\"ls\",\"/\"]}}" |
Envs | string | No | The environment variables that are used to deploy the application. Set this parameter to a JSON array. Valid values: regular environment variables, Kubernetes ConfigMap environment variables, and Kubernetes Secret environment variables. Specify regular environment variables in the following format:
Specify Kubernetes ConfigMap environment variables in the following format to reference values from ConfigMaps:
Specify Kubernetes Secret environment variables in the following format to reference values from Secrets:
Note
If you want to cancel this configuration, set this parameter to an empty JSON array, which is in the format of "[]".
| [{"name":"x1","value":"y1"},{"name":"x2","valueFrom":{"configMapKeyRef":{"name":"my-config","key":"y2"}}},{"name":"x3","valueFrom":{"secretKeyRef":{"name":"my-secret","key":"y3"}}}] |
ImageTag | string | No | The tag of the image. | latest |
BatchWaitTime | integer | No | The minimum time interval for the phased release of pods. For more information, see minReadySeconds . | 0 |
Command | string | No | The commands that you run to start the container. Note
If you want to cancel this configuration, set this parameter to an empty string in the format of "" .
| ls |
AppId | string | Yes | The ID of the application. You can call the ListApplication operation to query the application ID. For more information, see ListApplication . | e83acea6-****-47e1-96ae-c0e953772cdc |
PostStart | string | No | The post-start script. Example: | {\"exec\":{\"command\":[\"ls\",\"/\"]}}" |
Readiness | string | No | The configuration for the readiness check on the container. If the check fails, the traffic that passes through the Kubernetes service is not transmitted to the container. Example: | {"failureThreshold": 3,"initialDelaySeconds": 5,"successThreshold": 1,"timeoutSeconds": 1,"httpGet": {"path": "/consumer","port": 8080,"scheme": "HTTP","httpHeaders": [{"name": "test","value": "testvalue"}]}} |
Liveness | string | No | The configuration for the liveness check on the container. Example: | {"failureThreshold": 3,"initialDelaySeconds": 5,"successThreshold": 1,"timeoutSeconds": 1,"tcpSocket":{"host":"", "port":8080}} |
Args | string | No | The argument array in the container start-up command. Set this parameter to a JSON array in the format of | ["args1","args2"] |
Replicas | integer | No | The number of application instances. The minimum value is 0. | 1 |
Image | string | No | The absolute URL of the image. This parameter setting overwrites the setting of the ImageTag parameter. | registry-vpc.cn-beijing.aliyuncs.com/t****/app:v1 |
CpuLimit | integer | No | The maximum number of CPU cores allowed for each application instance when the application is running. Unit: cores. Value 0 indicates that no limit is set on CPU cores. | 1 |
MemoryLimit | integer | No | The maximum size of memory allowed for each application instance when the application is running. Unit: MB. Value 0 indicates that no limit is set on the memory size. | 0 |
CpuRequest | integer | No | The number of CPU cores requested for each application instance when the application is running. Unit: cores. We recommend that you set this parameter. Value 0 indicates that no limit is set on CPU cores. Note
You must set this parameter together with the CpuLimit parameter. Make sure that the value of this parameter does not exceed that of the CpuLimit parameter.
| 0 |
MemoryRequest | integer | No | The size of memory requested for each application instance when the application is running. Unit: MB. We recommend that you set this parameter. If you do not want to apply for a memory quota, set this parameter to 0. Note
You must set this parameter together with the MemoryLimit parameter. Make sure that the value of this parameter does not exceed that of the MemoryLimit parameter.
| 0 |
NasId | string | No | The ID of the File Storage NAS (NAS) file system mounted to the container in which the application is running. The NAS file system must be in the same region as the cluster. The NAS file system must have an available mount target, or have a mount target on the vSwitch in the virtual private cloud (VPC) in which the application resides. If you do not specify this parameter but specify the MountDescs parameter, a NAS file system is automatically purchased and mounted to the vSwitch in the VPC. | dfs23**** |
MountDescs | string | No | The description of the NAS mounting configuration. Set this parameter to a serialized JSON string. Example: | [{"nasPath": "/k8s","mountPath": "/mnt"},{"nasPath": "/files","mountPath": "/app/files"}] |
StorageType | string | No | The storage type of the NAS file system.
You can set this parameter only to Performance. | Performance |
LocalVolume | string | No | The configurations that are used when the host files are mounted to the container on which the application is running. Example: | [{"type":"","nodePath":"/localfiles","mountPath":"/app/files"},{"type":"Directory","nodePath":"/mnt","mountPath":"/app/storage"}] |
PackageUrl | string | No | The URL of the deployment package. This parameter is required if you use a FatJar or WAR package to deploy the application. Note
The version of EDAS SDK for Java or Python must be V2.44.0 or later.
| https://e***.oss-cn-beijing.aliyuncs.com/s***-1.0-SNAPSHOT-spring-boot.jar |
PackageVersion | string | No | The version of the deployment package. This parameter is required if you use a FatJar or WAR package to deploy the application. You must specify a version. Note
The version of EDAS SDK for Java or Python must be V2.44.0 or later.
| 20200720 |
JDK | string | No | The version of the Java Development Kit (JDK) on which the deployment package of the application depends. Open JDK 7 and Open JDK 8 are supported. This parameter is unavailable if you deploy applications by using images. | Open JDK 8 |
WebContainer | string | No | The version of the Tomcat container on which the deployment package of the application depends. This parameter is applicable to Spring Cloud and Dubbo applications that you deploy by using WAR packages. This parameter is unavailable if you deploy applications by using images. | apache-tomcat-7.0.91 |
EdasContainerVersion | string | No | The version of EDAS Container on which the deployment package of the application depends. This parameter is applicable to High-Speed Service Framework (HSF) applications that you deploy by using WAR packages. This parameter is unavailable if you deploy applications by using images. | 3.5.9 |
UriEncoding | string | No | The URI encoding scheme. Valid values: ISO-8859-1, GBK, GB2312, and UTF-8. Note
If you do not specify this parameter in the application configurations, the default URI encoding scheme in the Tomcat container is applied.
| GBK |
UseBodyEncoding | boolean | No | Specifies whether to use the encoding scheme specified in the request body for URI query parameters. Note
If this parameter is not specified in application configuration, the default value false is applied.
| false |
UpdateStrategy | string | No | The phased release policy.
| {"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}} |
McpuRequest | integer | No | The minimum number of CPU cores required. Unit: cores. Value 0 indicates that no limit is set on CPU cores. Note
You must set this parameter together with the CpuLimit parameter. Make sure that the value of this parameter does not exceed that of the CpuLimit parameter.
| 4 |
McpuLimit | integer | No | The maximum number of CPU cores allowed. Unit: cores. Value 0 indicates that no limit is set on CPU cores. | 0 |
VolumesStr | string | No | The data volume. | test |
PackageVersionId | string | No | The version ID of the deployment package. | 2bcc******** |
ChangeOrderDesc | string | No | The description of the change process. | Upgrade |
RuntimeClassName | string | No | The type of the container runtime. Valid values:
This parameter is applicable only to clusters that use sandboxed containers. | runc |
DeployAcrossZones | string | No | Specifies whether to distribute application instances across zones. Value true indicates that application instances are distrubuted across zones. Other values indicate that application instances are not distributed across zones. | true |
BatchTimeout | integer | No | The timeout period for an at-a-time release. Unit: seconds. | 60 |
EnableAhas | boolean | No | Specifies whether to enable access to Application High Availability Service (AHAS). | true |
WebContainerConfig | string | No | The Tomcat container configuration. If you want to cancel this configuration, set this parameter to
| {"useDefaultConfig":false,"contextInputType":"custom","contextPath":"hello","httpPort":8088,"maxThreads":400,"uriEncoding":"UTF-8","useBodyEncoding":true,"useAdvancedServerXml":false} |
JavaStartUpConfig | string | No | The configuration of Java startup parameters for a Java application. These startup parameters involve the memory, application, garbage collection (GC) policy, tools, service registration and discovery, and custom configurations. Proper parameter settings help reduce the GC overheads, shorten the server response time, and improve the throughput. Set this parameter to a JSON string. In the example, original indicates the configuration value, and startup indicates a startup parameter. The system automatically concatenates all startup values as the settings of Java startup parameters for the application. To delete this configuration, leave the parameter value empty by entering | {"InitialHeapSize":{"original":512,"startup":"-Xms512m"},"MaxHeapSize":{"original":1024,"startup":"-Xmx1024m"}} |
SlsConfigs | string | No | The Logstore configuration. If you want to cancel this configuration, leave the parameter value empty by entering
| [{"logstore":"thisisanotherfilelog","type":"file","logDir":"/var/log/*"},{"logstore":"","type":"stdout","logDir":"stdout.log"},{"logstore":"thisisafilelog","type":"file","logDir":"/tmp/log/*"}] |
DeployAcrossNodes | string | No | Specifies whether to distribute application instances to multiple nodes. Value true indicates that application instances are distrubuted across zones. Other values indicate that application instances are not distributed across zones. | true |
TrafficControlStrategy | string | No | The traffic adjustment policy for a canary release. | {"http":{"rules":[{"conditionType":"percent","percent":10}]}} |
PvcMountDescs | string | No | The configuration for mounting a Kubernetes PersistentVolumeClaim (PVC) to a directory in an elastic container instance. The following parameters are included in the configuration:
| [{"pvcName":"nas-pvc-1","mountPaths":[{"mountPath":"/usr/share/nginx/data"},{"mountPath":"/usr/share/nginx/html","readOnly":true}]}] |
ConfigMountDescs | string | No | The configuration for mounting a Kubernetes ConfigMap or Secret to a directory in an elastic container instance. The following parameters are included in the configuration:
| [ { "name": "nginx-config", "type": "ConfigMap", "mountPath": "/etc/nginx" }, { "name": "tls-secret", "type": "Secret", "mountPath": "/etc/ssh" } ] |
EnvFroms | string | No | The Kubernetes environment variables that are configured in EnvFrom mode. A ConfigMap or Secret is mounted to a directory. Each key corresponds to a file in the directory, and the content of the file is the value of the key. This parameter contains the following parameters:
| [{"name":"appname","valueFrom":{"configMapKeyRef":{"name":"appconf","key":"name"}}}] |
EmptyDirs | string | No | The configuration for mounting a Kubernetes emptyDir volume to a directory in an elastic container instance. The following parameters are included in the configuration:
| [{"mountPath":"/app-log","subPathExpr":"$(POD_IP)"},{"readOnly":true,"mountPath":"/etc/nginx"}] |
CustomAffinity | string | No | The affinity configuration of the pod. This parameter takes effect only if both the DeployAcrossNodes and DeployAcrossZones parameters are set to false. | {"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"beta.kubernetes.io/arch","operator":"NotIn","values":["arm64","arm32"]}]}]},"preferredDuringSchedulingIgnoredDuringExecution":[{"weight":5,"preference":{"matchExpressions":[{"key":"kubernetes.io/os","operator":"In","values":["linux"]}]}}]},"podAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":[{"namespaces":["default"],"topologyKey":"kubernetes.io/hostname","labelSelector":{"matchExpressions":[{"key":"edas.oam.acname","operator":"NotIn","values":["edas-test-app"]}]}}]},"podAntiAffinity":{"preferredDuringSchedulingIgnoredDuringExecution":[{"podAffinityTerm":{"namespaces":["default"],"topologyKey":"failure-domain.beta.kubernetes.io/zone","labelSelector":{"matchExpressions":[{"key":"edas.oam.acname","operator":"In","values":["edas-test-app-2"]}]}},"weight":15}]}} |
CustomTolerations | string | No | The scheduling tolerance configuration of the pod. This parameter takes effect only if both the DeployAcrossNodes and DeployAcrossZones parameters are set to false. | [{"key":"edas-taint-key2","operator":"Exists","effect":"NoExecute","tolerationSeconds":50},{"key":"edas-taint-key","operator":"Equal","value":"edas-taint-value","effect":"PreferNoSchedule"}] |
BuildPackId | string | No | The build package number of EDAS Container.
You can query the build package number by using one of the following methods:
| 59 |
Annotations | string | No | The annotation of an application pod. | {"annotation-name-1":"annotation-value-1","annotation-name-2":"annotation-value-2"} |
Labels | string | No | The label of an application pod. | {"label-name-1":"label-value-1","label-name-2":"label-value-2"} |
EnableEmptyPushReject | boolean | No | Specifies whether to enable the empty list protection feature. Valid values:
| false |
EnableLosslessRule | boolean | No | Specifies whether to enable graceful start rules. Valid values:
| true |
LosslessRuleWarmupTime | integer | No | The service prefetching duration. Valid values: 0 to 86400. Unit: seconds. | 120 |
LosslessRuleDelayTime | integer | No | The delay of service registration. Valid values: 0 to 86400. Unit: seconds. | 0 |
LosslessRuleFuncType | integer | No | The number of prefetching curves. Valid values: 0 to 20. The default value is 2, which is suitable for common prefetching scenarios. This value indicates that the received traffic amount of the provider during prefetching is displayed as a quadratic curve. | 2 |
LosslessRuleAligned | boolean | No | Specifies whether to enable Graceful Rolling Release and configure Complete Service Registration before Readiness Probing. Valid values:
Note
If you set both the LosslessRuleRelated parameter and this parameter to true, the operation checks whether the service prefetching is complete.
| false |
LosslessRuleRelated | boolean | No | Specifies whether to enable Graceful Rolling Release and configure Complete Service Prefetching before Readiness Probing. Valid values:
| false |
LimitEphemeralStorage | integer | No | The maximum size of space required by ephemeral storage. Unit: GB. Value 0 indicates that no limit is set on the ephemeral storage space. | 4 |
RequestsEphemeralStorage | integer | No | The minimum size of space required by ephemeral storage. Unit: GB. Value 0 indicates that no limit is set on the ephemeral storage space. | 2 |
ImagePlatforms | string | No | The destination image platform. This parameter takes effect only when you deploy applications by using .war or .jar packages.
|
Response parameters
Examples
Sample success responses
JSON
format
{
"ChangeOrderId": "cd65b247-****-475b-ad4b-7039040d625c",
"Code": 200,
"Message": "success",
"RequestId": "a5281053-08e4-47a5-b2ab-5c0323de*****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-01-30 | The request parameters of the API has changed | View Change Details |
2023-10-10 | The request parameters of the API has changed | View Change Details |
2023-04-11 | The request parameters of the API has changed | View Change Details |
2023-04-03 | The request parameters of the API has changed | View Change Details |
2023-03-27 | The request parameters of the API has changed | View Change Details |
2023-03-24 | The request parameters of the API has changed | View Change Details |