Deploys an application in a Container Service for Kubernetes (ACK) cluster or a Serverless Kubernetes (ASK) cluster.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
edas:ManageApplication |
update |
*Application
|
None | None |
Request syntax
POST /pop/v5/k8s/acs/k8s_apps HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PreStop |
string |
No |
The script to execute before stopping the container. Example: |
{ "exec":{ "command":[ "ls", "/" ] } } |
| Envs |
string |
No |
The environment variables for the deployment. The value must be a JSON array of objects. Three types of environment variables are supported: regular, Kubernetes ConfigMap, and Kubernetes Secret. The format for a regular environment variable is as follows:
A ConfigMap environment variable injects the value of a specified key from a ConfigMap into the container's environment variables. The format is as follows:
A Secret environment variable injects the value of a specified key from a Secret into the container's environment variables. The format is as follows:
Note
To clear this configuration, set the parameter to an empty JSON array `[]`. |
[{"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 image tag. |
latest |
| BatchWaitTime |
integer |
No |
The minimum interval for a phased release of pods. For more information, see minReadySeconds. |
0 |
| Command |
string |
No |
The container startup command. Note
To clear this configuration, set the parameter to an empty string |
ls |
| AppId |
string |
Yes |
The application ID. Obtain the ID by calling the ListApplication operation. For more information, see ListApplication. |
e83acea6-****-47e1-96ae-c0e953772cdc |
| PostStart |
string |
No |
The script to execute after the container starts. Example: |
{ "exec":{ "command":[ "ls", "/" ] } } |
| Readiness |
string |
No |
The readiness probe for the container. If the probe fails, traffic from the Kubernetes service is not routed 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 liveness probe for the container. Example: |
{"failureThreshold": 3,"initialDelaySeconds": 5,"successThreshold": 1,"timeoutSeconds": 1,"tcpSocket":{"host":"", "port":8080}} |
| Args |
string |
No |
The arguments for the container startup command. The value must be a JSON array of strings, such as |
["args1","args2"] |
| Replicas |
integer |
No |
The number of application instances. The minimum value is 0. |
1 |
| Image |
string |
No |
The full URL of the image. This parameter overwrites the ImageTag parameter. |
registry-vpc.cn-beijing.aliyuncs.com/t****/app:v1 |
| CpuLimit |
integer |
No |
The CPU limit for the application instance during runtime. Unit: cores. A value of 0 means no limit. |
1 |
| MemoryLimit |
integer |
No |
The memory limit for the application instance during runtime. Unit: MB. A value of 0 means no limit. |
0 |
| CpuRequest |
integer |
No |
The CPU quota to request for the application instance during runtime. Setting this parameter is recommended. Unit: cores. A value of 0 means no limit. Note
If you set this parameter, also set the CpuLimit parameter. The value of CpuRequest must be less than or equal to the value of CpuLimit. |
0 |
| MemoryRequest |
integer |
No |
The memory quota to request for the application instance during runtime. Setting this parameter is recommended. Unit: MB. A value of 0 means no request. Note
If you set this parameter, also set the MemoryLimit parameter. The value of MemoryRequest must be less than or equal to the value of MemoryLimit. |
0 |
| NasId |
string |
No |
The ID of the Apsara File Storage NAS (NAS) file system to mount. The NAS file system must be in the same region as the cluster. It must have an available mount target quota, or its mount target must be on a vSwitch in the VPC. If you do not set this parameter but the `mountDescs` field exists, a NAS file system is automatically purchased and mounted to a vSwitch in the VPC by default. |
dfs23**** |
| MountDescs |
string |
No |
The mount configurations, which are 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. Valid values:
Currently, only the `Performance` type is supported. |
Performance |
| LocalVolume |
string |
No |
The configuration for mounting a host file to a container. Example: |
[{"type":"","nodePath":"/localfiles","mountPath":"/app/files"},{"type":"Directory","nodePath":"/mnt","mountPath":"/app/storage"}] |
| PackageUrl |
string |
No |
The URL of the deployment package. Configure this parameter for applications deployed using a FatJar or WAR package. Note
The Java or Python SDK for EDAS POP API must be version 2.44.0 or later. |
https://e***.oss-cn-beijing.aliyuncs.com/s***-1.0-SNAPSHOT-spring-boot.jar |
| PackageVersion |
string |
No |
The version number of the deployment package. This parameter is required for WAR and FatJar packages. You can define the meaning of the version number. Note
The Java or Python SDK for EDAS POP API must be version 2.44.0 or later. |
20200720 |
| JDK |
string |
No |
The JDK version on which the deployment package depends. Valid values: Open JDK 7, Open JDK 8, or Custom OpenJDK. This parameter is not supported for image-based deployments. If you use Custom OpenJDK, you must also configure the `UserBaseImageUrl` field. |
Open JDK 8 |
| WebContainer |
string |
No |
The Tomcat version on which the deployment package depends. This parameter applies to Spring Cloud and Dubbo applications deployed using WAR packages. It is not supported for image-based deployments. |
apache-tomcat-7.0.91 |
| EdasContainerVersion |
string |
No |
The EDAS Container version on which the deployment package depends. This parameter applies to HSF applications deployed using WAR packages. It is not supported for image-based deployments. |
3.5.9 |
| UriEncoding |
string |
No |
The URI encoding format. Supported formats: ISO-8859-1, GBK, GB2312, and UTF-8. Note
If you do not set this parameter in the application configuration, the default Tomcat value is used. |
GBK |
| UseBodyEncoding |
boolean |
No |
Specifies whether to enable `useBodyEncodingForURI`. Note
If you do not set this parameter in the application configuration, the default value `false` is used. |
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 CPU resource requirement. Unit: cores. A value of 0 means no limit. Note
If you set this parameter, you must also set the `CpuLimit` parameter. The value must be less than or equal to the value of `CpuLimit`. |
4 |
| McpuLimit |
integer |
No |
The maximum CPU that can be used. Unit: cores. A value of 0 means no limit. |
0 |
| VolumesStr |
string |
No |
The data volumes. |
test |
| PackageVersionId |
string |
No |
The ID of the deployment package version. |
2bcc******** |
| ChangeOrderDesc |
string |
No |
The description of the change record. |
Upgrade |
| RuntimeClassName |
string |
No |
The container runtime type:
This parameter applies only to clusters that use sandboxed containers. |
runc |
| DeployAcrossZones |
string |
No |
Specifies whether to distribute application instances across multiple zones. `true` indicates yes, and other values indicate no. |
true |
| BatchTimeout |
integer |
No |
The timeout period for a single batch release. Unit: seconds. |
60 |
| EnableAhas |
boolean |
No |
Specifies whether to connect to Application High Availability Service (AHAS). |
true |
| WebContainerConfig |
string |
No |
The Tomcat container configuration. Set to
|
{"useDefaultConfig":false,"contextInputType":"custom","contextPath":"hello","httpPort":8088,"maxThreads":400,"uriEncoding":"UTF-8","useBodyEncoding":true,"useAdvancedServerXml":false} |
| JavaStartUpConfig |
string |
No |
The Java startup parameters. You can configure memory, application, garbage collection (GC) policy, tools, service registration and discovery, and custom settings. Correctly configuring these parameters helps reduce GC overhead, shorten server response time, and improve throughput. The parameter is a JSON string. `original` is the configuration value, and `startup` is the startup parameter. The system automatically concatenates all `startup` values as the Java startup parameters for the application. Set to |
{"InitialHeapSize":{"original":512,"startup":"-Xms512m"},"MaxHeapSize":{"original":1024,"startup":"-Xmx1024m"}} |
| SlsConfigs |
string |
No |
The Logstore configuration. Set to
|
[{"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 across multiple nodes. `true` indicates yes, and other values indicate no. |
true |
| TrafficControlStrategy |
string |
No |
The traffic control policy for phased release. |
{"http":{"rules":[{"conditionType":"percent","percent":10}]}} |
| PvcMountDescs |
string |
No |
Configures Kubernetes PersistentVolumeClaim (PVC) mounts. This lets you mount a Kubernetes PVC volume to a specified container directory. The parameters for `PvcMountDescs` are as follows:
|
[{"pvcName":"nas-pvc-1","mountPaths":[{"mountPath":"/usr/share/nginx/data"},{"mountPath":"/usr/share/nginx/html","readOnly":true}]}] |
| ConfigMountDescs |
string |
No |
Configures Kubernetes ConfigMap and Secret mounts. This lets you mount a ConfigMap or Secret to a specified container directory. The parameters for `ConfigMountDescs` are as follows:
|
[ { "name": "nginx-config", "type": "ConfigMap", "mountPath": "/etc/nginx" }, { "name": "tls-secret", "type": "Secret", "mountPath": "/etc/ssh" } ] |
| EnvFroms |
string |
No |
Configures environment variables of the Kubernetes `EnvFrom` type. This mounts a specified ConfigMap or Secret to a directory. Each key corresponds to a file in the directory, and the file content is the value of the key. The parameters for `EnvFroms` are as follows.
|
[{"name":"appname","valueFrom":{"configMapKeyRef":{"name":"appconf","key":"name"}}}] |
| EmptyDirs |
string |
No |
Configures Kubernetes `emptyDir` mounts. This lets you mount an `emptyDir` volume to a specified container directory. The parameters for `EmptyDirs` are as follows:
|
[{"mountPath":"/app-log","subPathExpr":"$(POD_IP)"},{"readOnly":true,"mountPath":"/etc/nginx"}] |
| CustomAffinity |
string |
No |
The pod affinity configuration. This takes effect only when both `DeployAcrossNodes` and `DeployAcrossZones` are `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 pod scheduling toleration configuration. This takes effect only when both `DeployAcrossNodes` and `DeployAcrossZones` are `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 for EDAS Container:
You can obtain the number in two ways:
|
59 |
| Annotations |
string |
No |
The annotations for the application pod. |
{"annotation-name-1":"annotation-value-1","annotation-name-2":"annotation-value-2"} |
| Labels |
string |
No |
The labels for the application pod. |
{"label-name-1":"label-value-1","label-name-2":"label-value-2"} |
| EnableEmptyPushReject |
boolean |
No |
Specifies whether to enable empty push protection:
|
false |
| EnableLosslessRule |
boolean |
No |
Specifies whether to enable the graceful start rule:
|
true |
| LosslessRuleWarmupTime |
integer |
No |
The service prefetch duration. Unit: seconds. The value ranges from 0 to 86400. |
120 |
| LosslessRuleDelayTime |
integer |
No |
The service registration latency. Unit: seconds. The value ranges from 0 to 86400. |
0 |
| LosslessRuleFuncType |
integer |
No |
The service prefetch curve. The value ranges from 0 to 20. The default is 2, which is suitable for general prefetch scenarios. This indicates that the traffic receiving curve of the service provider follows a quadratic curve during the prefetch period. |
2 |
| LosslessRuleAligned |
boolean |
No |
Specifies whether to enable the graceful rolling deployment mode to complete service registration before the readiness probe succeeds:
Note
If `LosslessRuleRelated` is also set to `true`, this interface checks whether service prefetch is complete.
|
false |
| LosslessRuleRelated |
boolean |
No |
Specifies whether to enable the graceful rolling deployment mode to complete service prefetch before the readiness probe succeeds:
|
false |
| LimitEphemeralStorage |
integer |
No |
The upper limit of the temporary storage resource requirement. Unit: GB. A value of 0 means no limit. |
4 |
| RequestsEphemeralStorage |
integer |
No |
The minimum temporary storage resource requirement. Unit: GB. A value of 0 means no limit. |
2 |
| Sidecars |
string |
No |
Sets a sidecar container for the application pod. The container configuration is in YAML format. The value is the base64-encoded YAML configuration of the sidecar container. |
[ { "yamlEncoded": "Y29tbWFuZDoKICAtIHRhaWwKICAtICctZicKICAtIC9kZXYvbnVsbAppbWFnZTogJ2J1c3lib3g6bGF0ZXN0JwpuYW1lOiBidXN5Ym94Cg==" } ] |
| InitContainers |
string |
No |
Sets an init container for the application pod. The container configuration is in YAML format. The value is the base64-encoded YAML configuration of the init container. |
[ { "yamlEncoded": "Y29tbWFuZDoKICAtIHNsZWVwCiAgLSAnNjAnCmltYWdlOiAnYnVzeWJveDpsYXRlc3QnCm5hbWU6IGluaXQtYnVzeWJveAo=" } ] |
| UserBaseImageUrl |
string |
No |
When using a custom JDK runtime, you must configure the base image address. This address must be publicly accessible. The EDAS server pulls this image to build the application image. |
openjdk:8u302 |
| CanaryRuleId |
string |
No |
The ID of the canary release rule policy. |
a8daf22e-****-968c7ff2ea34 |
| TerminateGracePeriod |
integer |
No |
The graceful stop timeout period for the application. Unit: seconds. |
120 |
| ImagePlatforms |
string |
No |
The target platform architecture for the image. This is valid when deploying with a WAR or JAR file. Examples:
|
linux/arm64,linux/amd64 |
| Startup |
string |
No |
The startup probe can be used to perform liveness checks on slow-starting containers to prevent them from being killed before they are up and running. Example: {"failureThreshold": 3,"initialDelaySeconds": 5,"successThreshold": 1,"timeoutSeconds": 1,"httpGet": {"path": "/consumer","port": 8080,"scheme": "HTTP","httpHeaders": [{"name": "test","value": "testvalue"}]}}. To delete this configuration, set the parameter to "" or {}. If you do not set this parameter, the configuration is ignored. |
{"failureThreshold": 3,"initialDelaySeconds": 5,"successThreshold": 1,"timeoutSeconds": 1,"tcpSocket":{"host":"", "port":8080}} |
| CustomAgentVersion |
string |
No |
Sets the version of the custom Application Real-Time Monitoring Service (ARMS) agent to mount to the application. Note
This feature is available only to whitelisted users. To use this feature, submit a ticket to be added to the whitelist. |
3.1.4 |
| SecurityContext |
string |
No |
Sets the `SecurityContext` property for the application pod container. The value is the base64-encoded YAML configuration of the `SecurityContext`. |
{"yamlEncoded":"cnVuQXNVc2VyOiAwCnJ1bkFzR3JvdXA6IDA="} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| ChangeOrderId |
string |
The ID of the change process. You can call the GetChangeOrderInfo operation to obtain it. For more information, see GetChangeOrderInfo. |
cd65b247-****-475b-ad4b-7039040d625c |
| Code |
integer |
The status of the interface or a POP error code. |
200 |
| Message |
string |
Additional information. |
success |
| RequestId |
string |
The request ID. |
a5281053-08e4-47a5-b2ab-5c0323de***** |
Examples
Success response
JSON format
{
"ChangeOrderId": "cd65b247-****-475b-ad4b-7039040d625c",
"Code": 200,
"Message": "success",
"RequestId": "a5281053-08e4-47a5-b2ab-5c0323de*****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.