K8s Application
Create an EDAS k8s application.For information about EDAS K8s Application and how to use it, see What is EDAS K8s Application.
NOTE: Available in 1.105.0+
Example Usage
Basic Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.edas.K8sApplication;
import com.pulumi.alicloud.edas.K8sApplicationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new K8sApplication("default", K8sApplicationArgs.builder()
.packageType("Image")
.applicationName("DemoApplication")
.applicationDescriotion("This is description of application")
.clusterId(var_.cluster_id())
.replicas(2)
.imageUrl("registry-vpc.cn-beijing.aliyuncs.com/edas-demo-image/consumer:1.0")
.packageUrl(var_.package_url())
.packageVersion(var_.package_version())
.jdk(var_.jdk())
.webContainer(var_.web_container())
.edasContainerVersion(var_.edas_container_version())
.internetTargetPort(var_.internet_target_port())
.internetSlbPort(var_.internet_slb_port())
.internetSlbProtocol(var_.internet_slb_protocol())
.internetSlbId(var_.internet_slb_id())
.limitCpu(4)
.limitMem(2048)
.requestsCpu(0)
.requestsMem(0)
.requestsMCpu(0)
.limitMCpu(4000)
.command(var_.command())
.commandArgs(var_.command_args())
.envs(var_.envs())
.preStop("{\"exec\":{\"command\":[\"ls\",\"/\"]}}")
.postStart("{\"exec\":{\"command\":[\"ls\",\"/\"]}}")
.liveness(var_.liveness())
.readiness(var_.readiness())
.nasId(var_.nas_id())
.mountDescs(var_.mount_descs())
.localVolume(var_.local_volume())
.namespace("default")
.logicalRegionId(cn_beijing)
.build());
}
}
Import
EDAS k8s application can be imported as below, e.g.
$ pulumi import alicloud:edas/k8sApplication:K8sApplication new_k8s_application application_id
Properties
The configuration of the host file mounted to the container. For example: [{"type":"","nodePath":"/localfiles","mountPath":"/app/files"},{"type":"Directory","nodePath":"/mnt", "mountPath":"/app/storage"}]
. Among them, nodePath is the host path; mountPath is the path in the container; type is the mount type.
The ID of the mounted NAS must be in the same region as the cluster. It must have an available mount point creation quota, or its mount point must be on a switch in the VPC. If it is not filled in and the mountDescs field exists, a NAS will be automatically purchased and mounted on the switch in the VPC by default.
Container service status check. If the check fails, the traffic passing through K8s Service will not be transferred to the container. The format is: {"failureThreshold": 3,"initialDelaySeconds": 5,"successThreshold": 1,"timeoutSeconds": 1, "httpGet": {"path": "/consumer","port": 8080,"scheme": "HTTP","httpHeaders": [{"name": "test","value": "testvalue"} ]}}
.