All Products
Search
Document Center

Enterprise Distributed Application Service:Configure sidecar containers and init containers

Last Updated:Mar 24, 2025

Configuring sidecar containers for an application can help you run auxiliary services, such as log collection, configuration updates, and network proxies. You can also configure init containers for an application to help you perform specific preparations before the application container starts. The preparations include setting up configuration files, downloading application dependencies, waiting for other services to get ready, and migrating databases. This topic describes how to configure sidecar and init containers when you create an application.

Terms

  • Sidecar Containers

    Works with an application container and provides the log collection and traffic hijacking capabilities for the application container. A sidecar container shares storage and network resources with an application container. This way, the sidecar container can directly communicate with the application container.

  • Init Container

    Prepare resources and executes special scripts for an application container. Init containers are a set of special containers. Multiple init containers are executed in sequence. Application containers start only if all init containers are executed. For more information, see Init Containers.

Procedure

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, choose Application Management > Applications. In the top navigation bar, select a region. In the upper part of the Applications page, select a microservices namespace from the Microservices Namespace drop-down list.

  3. On the Applications page, click Create Application.

  4. In the Basic Information step, configure the relevant parameters as required and click Next.

  5. 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.

  6. In the Advanced Settings step, click Configure sidecars and InitContainers, configure the parameters based on your business requirements, and then click Next. The following table describes the parameters.

    Parameter

    Description

    Sidecar Container

    You can configure only one sidecar container in a single editor. If you want to configure multiple sidecar containers, click + Add Sidecar Containers.

    • The following sample code provides an example on how to mount a sidecar container to an application container to provide the BusyBox toolbox.

      name: busybox
      image: busybox:latest
      command: ["tail","-f" ,"/dev/null"]
    • For information about how to mount a sidecar container to an application container to collect logs by using Logtail, see Use CRDs to collect container text logs in Sidecar mode.

    Init Container

    You can configure only one init container in a single editor. If you want to configure multiple init containers, click + Add Init Container.

    The following sample code provides an example on how to configure an init container that sleeps for 60 seconds before the application container starts.

    name: busybox
    image: busybox:latest
    command: ["sleep", "60"]

  7. After you configure the advanced settings, click Create Application. In the Creation Completed step, click Create Application.

  8. In the Confirm Application Change Precheck dialog box, click Start Precheck.

    1. After the data in the dialog box is refreshed, confirm the precheck items and results and click Continue.

    2. (Optional) If you modify the preceding precheck items, click Check Again.

    The application requires several minutes to be deployed. During the process, you can view the change records to track the deployment progress of the application on the Change List page. After you deploy the application, go to the Application Overview page to view the running status of pods. If the pods are in the running state, the application is deployed. You can click the running status of pods to view the Deployments, pods, and advanced configurations of the application instances.

References

For information about other parameters that are used when you create or deploy an application, see Create a Kubernetes application by using the default application source.