Creates an application in a Container Service for Kubernetes (ACK) cluster or serverless Kubernetes cluster.
Debugging
Authorization information
Request syntax
POST /pop/v5/k8s/acs/create_k8s_app
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
IntranetTargetPort | integer | No | The backend port of the internal-facing Server Load Balancer (SLB) instance. This port also serves as the service port of the application. Valid values: 1 to 65535. | 80 |
IntranetSlbPort | integer | No | The frontend port of the internal-facing SLB instance. Valid values: 1 to 65535. | 80 |
ImageUrl | string | No | The URL of the image. This parameter is required if you set the | registry.cn-beijing.aliyuncs.com/****_test/****-cons****:1.0 |
ApplicationDescription | string | No | The description of the application. | Application in the production environment |
RepoId | string | No | The ID of the image repository. | ced******** |
Replicas | integer | No | The number of application instances. | 4 |
LimitCpu | integer | No | The maximum number of CPU cores allowed for each application instance when the application is running. Unit: cores. If the LimitmCpu parameter is specified, you can ignore this parameter. | 4 |
LimitMem | integer | No | The maximum size of memory allowed for each application instance when the application is running. Unit: MB. The value of LimitMem must be greater than that of RequestsMem. | 2 |
RequestsCpu | integer | No | The maximum number of CPU cores allowed for each application instance when the application is created. Unit: cores. Value 0 indicates that no limit is set on CPU cores. If the RequestsmCpu parameter is specified, the value of the RequestsmCpu parameter is used. You can ignore this parameter. | 0 |
RequestsMem | integer | No | The maximum size of memory allowed for each application instance when the application is created. Unit: MB. Value 0 indicates that no limit is set on the memory size. The value of RequestsMem cannot be greater than that of LimitMem. | 0 |
Command | string | No | The application startup command. If you specify this parameter, the value of this parameter will replace the startup command in the image. | ls |
CommandArgs | string | No | The arguments in the command. The parameter value is a JSON array of strings. An example is | [{"argument":"-lh"}] |
AppName | string | Yes | The name of the application. The name must start with a letter, and can contain digits, letters, and hyphens (-). It can be up to 36 characters in length. | doc-test |
IntranetSlbProtocol | string | No | The protocol used by the internal-facing SLB instance. Valid values: TCP, HTTP, and HTTPS. | TCP |
IntranetSlbId | string | No | The ID of the internal-facing SLB instance. If you do not specify this parameter, Enterprise Distributed Application Service (EDAS) automatically purchases a new SLB instance for you. | ae93******** |
ClusterId | string | Yes | The ID of the cluster. You can call the ListCluster operation to query the cluster ID. For more information, see ListCluster . | c9cd**** |
InternetSlbId | string | No | The ID of the Internet-facing SLB instance. If you do not specify this parameter, EDAS automatically purchases a new SLB instance for you. | a3d4******** |
InternetSlbProtocol | string | No | The protocol used by the Internet-facing SLB instance. Valid values: TCP, HTTP, and HTTPS. | TCP |
InternetSlbPort | integer | No | The frontend port of the Internet-facing SLB instance. Valid values: 1 to 65535. | 80 |
InternetTargetPort | integer | No | The backend port of the internal-facing SLB instance. This port also serves as the service port of the application. Valid values: 1 to 65535. | 8080 |
Envs | string | No | The environment variables that are used to deploy the application. The value must be a JSON array. Valid values: regular environment variables, Kubernetes ConfigMap environment variables, or 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 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"}}}] |
PreStop | string | No | The pre-stop script. Example: If you want to cancel this configuration, leave this parameter empty by setting it to | {\"exec\":{\"command\":[\"ls\",\"/\"]}}" |
PostStart | string | No | The post-start script. Example: If you want to cancel this configuration, leave this parameter empty by setting it to | {\"exec\":{\"command\":[\"ls\",\"/\"]}}" |
Liveness | string | No | The configuration for the liveness check on the container. Example: If you want to cancel this configuration, leave the parameter value empty by entering | {"failureThreshold": 3,"initialDelaySeconds": 5,"successThreshold": 1,"timeoutSeconds": 1,"tcpSocket":{"host":"", "port":8080}} |
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"}\]}}`.`` If you want to cancel this configuration, leave the parameter value empty by entering | {"failureThreshold": 3,"initialDelaySeconds": 5,"successThreshold": 1,"timeoutSeconds": 1,"httpGet": {"path": "/consumer","port": 8080,"scheme": "HTTP","httpHeaders": [{"name": "test","value": "testvalue"}]}} |
NasId | string | No | The ID of the Network Attached Storage (NAS) file system that you want to mount to the application. 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"}] |
Namespace | string | No | The namespace of the Kubernetes cluster. This parameter specifies the Kubernetes namespace in which your application is deployed. By default, the default namespace is used. | default |
LogicalRegionId | string | No | The ID of the EDAS namespace. This parameter is required for a non-default namespace. | cn-shenzhen:beta**** |
PackageType | string | No | The type of the deployment package. Valid values: FatJar, WAR, and Image. | WAR |
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. Valid values: Open JDK 7 and Open JDK 8. 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 Note
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 |
RequestsmCpu | integer | No | The maximum number of CPU cores allowed for each application instance when the application is created. Unit: millicores. | 500 |
LimitmCpu | integer | No | The maximum number of CPU cores allowed for each application instance when the application is running. Unit: millicores. Value 0 indicates that no limit is set on CPU cores. | 1000 |
RuntimeClassName | string | No | The type of the container runtime. 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 |
Timeout | integer | No | The timeout period of the change process. Valid values: 1 to 1800. Unit: seconds. If you do not specify this Unidentifiedparameter, the default value 1800 is used. | 60 |
EnableAhas | boolean | No | Specifies whether to enable access to Application High Availability Service (AHAS). Valid values:
| true |
WebContainerConfig | string | No | The configuration of the Tomcat container. If you want to cancel this configuration, set this parameter to "" or "{}". The following parameters are included in the configuration:
| {"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. Appropriate 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"},"CustomParams":{"original":"-Dcustom.property.sample=false","startup":"-Dcustom.property.sample=false"}} |
SlsConfigs | string | No | The Logstore configuration. To delete 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/*"}] |
IsMultilingualApp | boolean | No | Specifies whether the application is a multi-language application. | true |
DeployAcrossNodes | string | No | Specifies whether to distribute application instances across nodes. Value | true |
PvcMountDescs | string | No | The configuration for mounting a Kubernetes PersistentVolumeClaim (PVC) volume 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"}] |
CsClusterId | string | No | The ID of the cluster. This parameter is required only when you create the application in a cluster that has not been imported. | abcdefg |
EnableAsm | boolean | No | Specifies whether to activate Alibaba Cloud Service Mesh (ASM). Set this parameter to true only when you create the application in a cluster that has not been imported and you need to use ASM. | false |
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. The following parameters are included in the configuration:
| [{"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"}] |
BuildPackId | string | No | The version of | -1 |
CustomAffinity | string | No | The custom affinity. | demo |
CustomTolerations | string | No | The custom tolerances. | demo |
ResourceGroupId | string | No | The ID of the resource group. | 461 |
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 of the provider during prefetching is displayed as a quadratic curve. | 2 |
LosslessRuleAligned | boolean | No | Specifies whether to enable the graceful rolling deployment mode and ensure that the service is registered before the readiness check. Valid values:
| false |
LosslessRuleRelated | boolean | No | Specifies whether to enable the graceful rolling deployment mode and ensure that the service prefetching is complete before the readiness check. Valid values:
| false |
ServiceConfigs | string | No | The configurations of services in a Kubernetes cluster. | [{"name": "test-svc-create","serviceType":"ClusterIP","portMappings":[{"servicePort": {"targetPort":8080,"port":80,"protocol":"TCP"}}]}] |
AppTemplateName | string | No | The name of the template used to create the application. If you specify an application template when you create an application, the application template and the AppConfig parameter are used to configure the application. Other configurations are ignored. | app-template001 |
AppConfig | string | No | The application configuration when the application template is used. Set this parameter to a JSON array. | {} |
LimitEphemeralStorage | integer | No | The maximum size of space required by ephemeral storage. Unit: GB. Value 0 indicates that no limit is set on the space size. | 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 space size. | 2 |
SecretName | string | No | The name of the credential that is used to pull the images specified by the user. You must configure the Secret. | edas-app-01-image-secret |
ContainerRegistryId | string | No | The ID of the repository used to build the image repository. If this parameter is left empty, the default repository provided by EDAS is used. Only the default repository provided by EDAS is supported. | Leave empty |
WorkloadType | string | No | The type of Workload when creating an application is currently only supported for the Deployment type. | Deployment |
Sidecars | string | No | Set up a Sidecar container for the application Pod. Support setting the format YAML for container configuration, which is the value of Sidecar container YAML configured with base64 encoding. | [{"yamlEncoded":"Y29tbWFuZDoKICAtIHRhaWwKICAtICctZicKICAtIC9kZXYvbnVsbAppbWFnZTogJ2J1c3lib3g6bGF0ZXN0JwpuYW1lOiBidXN5Ym94Cg=="}] |
InitContainers | string | No | Set the initialization container for the application Pod. Support setting the format YAML for container configuration, which is the value of Init container YAML configured with base64 encoding. | [ { "yamlEncoded": "Y29tbWFuZDoKICAtIHNsZWVwCiAgLSAnNjAnCmltYWdlOiAnYnVzeWJveDpsYXRlc3QnCm5hbWU6IGluaXQtYnVzeWJveAo=" } ] |
UserBaseImageUrl | string | No | When using custom JDK runtime, it is necessary to configure the basic image address. The address needs to be publicly accessible, and the EDAS server will pull the image to build the application image. | openjdk:8u302 |
TerminateGracePeriod | integer | No | Set the grace stop timeout for the application. Unit: seconds. | 120 |
ImagePlatforms | string | No | Mirror the target platform architecture, which is effective when deployed using war or jar. Enter an example:
| |
Startup | string | No | The startup probe can be used to detect the viability of slow start containers, avoiding them from being killed before startup. The format is as follows: {"FailureThreshold": 3, "initialDelaySeconds": 5, "SuccessThreshold": 1, "timeoutSeconds": 1, "https Get": {"path": "/consumer", "port": 8080, "scheme": "HTTP", "https Headers": [{"name": "test", "value": "testvalue"}]}. If set to "" or {}, it means delete, and if not set, it means ignore. | {"failureThreshold": 3,"initialDelaySeconds": 5,"successThreshold": 1,"timeoutSeconds": 1,"tcpSocket":{"host":"", "port":8080}} |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": 200,
"Message": "success",
"RequestId": "b197-40ab-9155-****",
"ApplicationInfo": {
"ChangeOrderId": "cd65b247-****-475b-ad4b-7039040d625c",
"AppName": "test",
"Dockerize": true,
"Owner": "zp",
"EdasId": "1172****6608****",
"ClusterType": 5,
"AppId": "e83acea6-****-47e1-96ae-c0e95377****",
"UserId": "edas_test****@aliyun****.com",
"RegionId": "cn-beijing"
}
}
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 | see changesets | ||||||
| ||||||||
2023-11-13 | The request parameters of the API has changed | see changesets | ||||||
| ||||||||
2023-10-10 | The request parameters of the API has changed | see changesets | ||||||
| ||||||||
2023-06-02 | The request parameters of the API has changed | see changesets | ||||||
| ||||||||
2023-03-27 | The request parameters of the API has changed | see changesets | ||||||
| ||||||||
2023-03-24 | The request parameters of the API has changed | see changesets | ||||||
|