All Products
Search
Document Center

InsertK8sApplication

Last Updated: May 30, 2019

Function

Create a Kubernetes application of Container Service.

Request URL

/pop/v5/k8s/acs/create_k8s_app

Request method

POST

Request parameters

Parameter Type Required Description
AppName String Yes Application name The value can contain numbers, letters, and underscores (_). It starts with a letter and contains up to 36 characters.
ClusterId String Yes Cluster ID
Replicas Integer Yes Number of application instances
ImageUrl String Yes Image address, for example, registry.cn-beijing.aliyuncs.com/edas_test1/edas-consumer:1.0
RepoId String No Image repoId
ApplicationDescription String No Application description
RequestsCpu Integer No CPU limit for the application instance when the application is created, in unit of cores.
RequestsMem Integer No Memory limit for the application instance when the application is created, in unit of MB.
LimitCpu Integer No CPU limit for the application instance when the application is running, in unit of cores.
LimitMem Integer No Memory limit for the application instance when the application is running, in unit of MB.
Command String No Command that you set. If this parameter is set, it overwrites the startup command in the image when the image is started.
CommandArgs String No This parameter is used with commands, which must be a string in JSON array format, for example, [{"argument":"-c"},{"argument":"test"}]. Where, -c and test are required parameters.
IntranetSlbId String No ID of the intranet-based SLB instance. If this parameter is not set, EDAS automatically buys an SLB instance for you.
IntranetSlbProtocol String No Protocol for the intranet-based SLB instance. The parameter value can be “TCP” only.
IntranetSlbPort Integer No Frontend port of the intranet-based SLB instance. The value ranges from 1 to 65535.
IntranetTargetPort Integer No Backend port of the intranet-based SLB instance, and also the service port of the application. The value ranges from 1 to 65535.
InternetSlbId String No ID of the Internet-based SLB instance. If this parameter is not set, EDAS automatically buys an SLB instance for you.
InternetSlbProtocol String No Protocol for the Internet-based SLB instance. The parameter value can be “TCP” only.
InternetSlbPort Integer No Frontend port of the Internet-based SLB instance. The value ranges from 1 to 65535.
InternetTargetPort Integer No Backend port of the Internet-based SLB instance, and also the service port of the application. The value ranges from 1 to 65535.
Envs String No Container environment variable, which must be a string in JSON array format, for example, [{"name":"testkey","value":"testValue"}]
liveness String No Container liveness status monitoring, format:{"failureThreshold": 3,"initialDelaySeconds": 5,"successThreshold": 1,"timeoutSeconds": 1,"tcpSocket":{"host":"", "port":8080}}
readiness String No Container readiness status check. If the check fails, the traffic passing through the Kubernetes service is not transmitted to the container. The parameter is in the format of {"failureThreshold": 3,"initialDelaySeconds": 5,"successThreshold": 1,"timeoutSeconds": 1,"httpGet": {"path": "/consumer","port": 8080,"scheme": "HTTP","httpHeaders": [{"name": "test","value": "testvalue"}]}}.
postStart String No Post-start script, format: {"exec":{"command":["cat","/etc/group"]}}
preStop String No Pre-stop script, format: {"tcpSocket":{"host":"", "port":8080}}
namespace String No Namespace of the Kubernetes cluster, which determines the deployment location of your application. Default value: default.
nasId String No ID of the mounted NAS, which must be in the same region as the Kubernetes cluster. The quota for creating an NAS mount point must be available or an NAS mount point is deployed on the switch in VPC. If this parameter is not set and the mountDescs field is available, EDAS automatically buys an NAS and mounts it to the switch in VPC.
mountDescs String No Mount configuration description, which is a serialized string in JSON array format, for example, [{"nasPath": "/k8s","mountPath": "/mnt"},{"nasPath": "/files","mountPath": "/app/files"}]. Where, nasPath indicates the file storage path and mountPath indicates the mount path to the container.
storageType String No SSD supported only, Performance.
localvolume String No Configuration for mounting host files to the container, for example, [{"type":"","nodePath":"/localfiles","mountPath":"/app/files"},{"type":"Directory","nodePath":"/mnt","mountPath":"/app/storage"}]. Where, nodePath indicates the host path, mountPath indicates the mount path to the container, and type indicates the mount type. For more information, see Host storage type description.

Response parameters

Parameter Type Description
Code Integer Code
Message String Message
ApplicationInfo ApplicationInfo Application details

ApplicationInfo

Parameter (Internet) Type Description
AppName String Application ID
AppId String Application name
RegionId String Region ID
EdasId String User ID
Owner String Application creator
Dockerize Boolean Indicates whether the application is a Docker application
ChangeOrderId Integer Change process ID
ClusterType Integer Environmental type of the application cluster.
0: Common Docker cluster
1: Swarm cluster
2: ECS cluster
3: Kubernetes cluster
4: Automatically registered Pandora cluster
5: Kubernetes cluster (based on Container Service)