All Products
Search
Document Center

Enterprise Distributed Application Service:Configure a startup command

Last Updated:Nov 28, 2023

In the Enterprise Distributed Application Service (EDAS) console, you can use an image, a JAR package, or a WAR package to deploy an application in a Kubernetes cluster. If you are proficient in Docker and JVM and want to set the startup parameters based on your business requirements, you can configure your container startup and runtime commands.

Background information

When you create an image, the container startup configurations you have specified by using the ENTRYPOINT or CMD command in your Dockerfile are preferentially used.

Important
  • If you are not familiar with the CMD or ENTRYPOINT content of the original Dockerfile image, we recommend that you do not customize the startup command and parameters. Invalid custom commands cause failures in creating applications.

  • In the Docker runtime, only one ENTRYPOINT command can take effect. Therefore, the startup command configured in the EDAS console overwrites the ENTRYPOINT and CMD commands that were configured when you created the Docker container image.

For example, if you configure the ENTRYPOINT [nginx, '-g', 'daemon off;'] command in your Dockerfile, the command is the first command to be run upon the container startup.

FROM ubuntu
ENTRYPOINT [nginx, '-g', 'daemon off;']                

You can configure a startup command when you create or deploy your application, or after your application is deployed. This topic describes how to configure a startup command in different scenarios.

Configure a startup command when you create your application

  1. Log on to the EDAS console. In the left-side navigation pane, choose Application Management > Applications. The Applications page appears. In the top navigation bar, select a region. In the upper part of the page, select a namespace. In the upper-left corner, click Create Application.

  2. In the Basic Information step, specify Cluster Type and Application Runtime Environment and click Next. The following table describes the parameters.

    Parameter

    Description

    Cluster Type

    The type of the cluster in which you want to deploy the application. Select Kubernetes Clusters.

    Application Runtime Environment

    The application runtime environment. Select an application runtime environment based on the type of the hosted application.

    • Java

      • Custom: Select this option if you want to use a custom image to deploy the application in a Kubernetes cluster.

      • Java: Select this option if you want to use a universal JAR package to deploy the application as a Dubbo or a Spring Boot application. You can set the Java Environment parameter after you select this option.

      • Tomcat: Select this option if you want to use a universal WAR package to deploy the application as a Dubbo or a Spring application. You can set the Java Environment and Container Version parameters after you select this option.

      • EDAS-Container (HSF): Select this option if you want to use a WAR or FatJar package to deploy the application as a High-speed Service Framework (HSF) application. You can set the Java Environment, Pandora Version, and Ali-Tomcat Version parameters after you select this option.

    • PHP: Select this option if the application is a PHP application that runs on Apache HTTP Server.

    • Node.js, C++, Go, and Other Languages: Select this option if you want to use a custom image to deploy the application in a Kubernetes cluster. The configuration process for multi-language applications is not described in this topic.

  3. In the Configurations step, configure the environment information, basic information, and deployment method for the application, set the related resource parameters, and then click Next.

  4. In the Advanced Settings step, click Startup Command and configure a startup command based on your business requirements.

    Startup Command

    The ENTRYPOINT: [nginx, '-g', 'daemon off;'] command is used as an example.

    Parameter

    Description

    Startup Command

    Enter a startup command, such as nginx.

    Startup Parameters

    Specify only one parameter in each row. For example, enter -g in the field. Then, click Add and enter daemon off in another field.

  5. Click Create Application.

  6. On the Creation Completed page, check the information in the Basic Information, Configurations, and Advanced Settings sections. Then, click Create Application.

    In the upper part of the Application Overview page, click View Details. On the Change List page, view the application change process. Wait several minutes until the application is deployed. After the application change process is complete, view the status of the instance in the Basic Information section of the Application Overview page. If the status shows that a pod is running, the application is deployed.

Configure a startup command when you update your application

You can configure a startup command when you create your application. You can also configure or update your startup command when you deploy your application.

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, click Application Management > Applications. In the top navigation bar, select a region. In the upper part of the page, select a namespace. Select Container Service or Serverless Kubernetes Cluster from the Cluster Type drop-down list. Then, find the application that you want to deploy and click the application name.

  3. On the Overview or Basic information page, choose Deploy > Deploy in the upper-right corner.

  4. On the Select Deployment Mode page, select a deployment mode and click Start Deployment in the upper-right corner of the specified deployment mode section.

  5. Specify the environment and the deployment package that you want to use for your application, click Startup Command, complete the configuration based on your business requirements, and then click OK.

    Startup Command

    The ENTRYPOINT: [nginx, '-g', 'daemon off;'] command is used as an example.

    Parameter

    Description

    Startup Command

    Enter a startup command, such as nginx.

    Startup Parameters

    Specify only one parameter in each row. For example, enter -g in the field. Then, click Add and enter daemon off in another field.

    Important

    The application is restarted after you click OK. We recommend that you perform this operation during off-peak hours.

Verify the result

  • Method 1

    In the left-side navigation pane of the application details page, click Change Records to view the change details of the application. If the value in the Change Status column is Success, the application is deployed and the configuration takes effect.

  • Method 2

    On the Application Overview page, click Running Pods (Click View) next to Running Status. In the Pod section of the App Configurations panel, check the Status column of the pod. If a green dot appears, the application is in the running state. This means that the application is deployed as expected and the configuration takes effect.