All Products
Search
Document Center

Enterprise Distributed Application Service:StartK8sAppPrecheck

Last Updated:Jan 08, 2024

Starts precheck for Kubernetes application changes.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Debug

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /pop/v5/k8s/app_precheck

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The ID of the cluster.

c37aec2a-bcca-4ec1-****-****
NamespacestringYes

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
AppIdstringNo

The ID of the application.

af58edcf-f7eb-****-****-db4e425f****
AppNamestringNo

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.

testapp
ReplicasintegerNo

The number of application instances.

2
LimitmCpuintegerNo

The maximum number of CPU cores allowed for each application instance when the application is running. Unit: millicores. The value 0 indicates that no limit is set on CPU cores.

1000
RequestsmCpuintegerNo

The maximum number of CPU cores allowed for each application instance when the application is created. Unit: millicores.

500
LimitMemintegerNo

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 or equal to that of RequestsMem.

4096
RequestsMemintegerNo

The maximum size of memory allowed for each application instance when the application is created. Unit: MB. The value 0 indicates that no limit is set on the memory size. The value of RequestsMem cannot be greater than that of LimitMem.

1024
LimitEphemeralStorageintegerNo

The maximum size of space required by ephemeral storage. Unit: GB. The value 0 indicates that no limit is set on the ephemeral storage space.

4
RequestsEphemeralStorageintegerNo

The minimum size of space required by ephemeral storage. Unit: GB. The value 0 indicates that no limit is set on the ephemeral storage space.

2
EnvsstringNo

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, and Kubernetes Secret environment variables. Specify regular environment variables in the following format:

{"name":"x", "value": "y"}

Specify Kubernetes ConfigMap environment variables in the following format to reference values from ConfigMaps:

{ "name": "x2", "valueFrom": { "configMapKeyRef": { "name": "my-config", "key": "y2" } } }

Specify Kubernetes Secret environment variables in the following format to reference values from Secrets:

{ "name": "x3", "valueFrom": { "secretKeyRef": { "name": "my-secret", "key": "y3" } } }

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"}}}]
EnvFromsstringNo

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 of the EnvFroms parameter:

  • configMapRef: the ConfigMap that is referenced. The following parameter is included:

    name: the name of the ConfigMap.

  • secretRef: the Secret that is referenced. The following parameter is included:

    name: the name of the Secret.

[{"name":"appname","valueFrom":{"configMapKeyRef":{"name":"appconf","key":"name"}}}]
EmptyDirsstringNo

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: The mount path in the container. This parameter is required.
  • readOnly: (Optional) The mount mode. The value true indicates the read-only mode. The value false indicates the read and write mode. Default value: false.
  • subPathExpr: (Optional) The regular expression that is used to match the subdirectory.
[{"mountPath":"/app-log","subPathExpr":"$(POD_IP)"},{"readOnly":true,"mountPath":"/etc/nginx"}]
JavaStartUpConfigstringNo

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 "" or "{}". The following parameters are included in the configuration:

  • InitialHeapSize: the initial size of the heap memory.
  • MaxHeapSize: the maximum size of the heap memory.
  • CustomParams: the custom parameters, such as JVM -D parameters.
  • Other parameters: You can view the JSON structure submitted by the frontend.
{"InitialHeapSize":{"original":512,"startup":"-Xms512m"},"MaxHeapSize":{"original":1024,"startup":"-Xmx1024m"}}
ConfigMountDescsstringNo

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: the name of the Kubernetes ConfigMap or Secret.
  • type: the type of the API object that you want to mount. You can mount a Kubernetes ConfigMap or Secret.
  • mountPath: the mount path. The mount path must be an absolute path that starts with a forward slash (/).
[{"name":"nginx-config","type":"ConfigMap","mountPath":"/etc/nginx"},{"name":"tls-secret","type":"secret","mountPath":"/etc/ssh"}]
PvcMountDescsstringNo

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: the name of the PVC. Make sure that the volume exists and is in the Bound state.

  • mountPaths: the directory to which you want to mount the PVC. You can configure multiple directories. You can set the following two parameters for each mount directory:

    • mountPath: the mount path. The mount path must be an absolute path that starts with a forward slash (/).
    • readOnly: the mount mode. The value true indicates the read-only mode. The value false indicates the read and write mode. Default value: false.
[{"pvcName":"nas-pvc-1","mountPaths":[{"mountPath":"/usr/share/nginx/data"},{"mountPath":"/usr/share/nginx/html","readOnly":true}]}]
AnnotationsstringNo

The annotation of an application pod.

{"annotation-name-1":"annotation-value-1","annotation-name-2":"annotation-value-2"}
LabelsstringNo

The label of an application pod.

{"label-name-1":"label-value-1","label-name-2":"label-value-2"}
ImageUrlstringNo

The URL of the image.

registry.cn-hangzhou.aliyuncs.com/mw/testapp:latest
PackageUrlstringNo

The URL of the deployment package.

https://e***.oss-cn-beijing.aliyuncs.com/s***-1.0-SNAPSHOT-spring-boot.jar
LocalVolumestringNo

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"}\]. Description:

  • nodePath: the host path.
  • mountPath: the path in the container.
  • type: the mounting type.
[{"type":"","nodePath":"/localfiles","mountPath":"/app/files"},{"type":"Directory","nodePath":"/mnt","mountPath":"/app/storage"}]
RegionIdstringNo

The ID of the region.

cn-hangzhou
ComponentIdsstringNo

The ID of the application component. You can call the ListComponents operation to query application components. This parameter must be specified when the application runs in Apache Tomcat or in a standard Java application runtime environment. The Apache Tomcat application runtime environment is applicable to Dubbo applications that are deployed by using WAR packages. A standard Java application runtime environment is applicable to Spring Boot or Spring Cloud applications that are deployed by using JAR packages.

Valid values for regular application component IDs:

  • 4: Apache Tomcat 7.0.91
  • 5: OpenJDK 1.8.x
  • 6: OpenJDK 1.7.x
  • 7: Apache Tomcat 8.5.42

This parameter is available only for Java SDK 2.57.3 or later, or Python SDK 2.57.3 or later. Assume that you use an SDK that is not provided by Enterprise Distributed Application Service (EDAS), such as aliyun-python-sdk-core, aliyun-java-sdk-core, and Alibaba Cloud CLI. In this case, you can directly specify this parameter.

7

Response parameters

ParameterTypeDescriptionExample
object

The returned content.

RequestIdstring

The ID of the request.

7638276F-****-****-884F-54CC0BC84A8D
Codeinteger

The HTTP status code.

200
Messagestring

The returned message.

success
Dataobject

The returned data.

Jobsarray

The jobs and the details about the jobs.

string

The name of the job.

Cluster Health Check

Examples

Sample success responses

JSONformat

{
  "RequestId": "7638276F-****-****-884F-54CC0BC84A8D",
  "Code": 200,
  "Message": "success",
  "Data": {
    "Jobs": [
      "Cluster Health Check\n"
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
500Edas.errorcode.PermissionDenied.messageYou are not authorized to perform the operation.No permissions

For a list of error codes, visit the Service error codes.