All Products
Search
Document Center

Enterprise Distributed Application Service:Configure sidecar containers and init containers

Last Updated:Mar 11, 2026

Containerized applications often need auxiliary processes -- log shippers, network proxies, or configuration agents -- running alongside the main application, or setup tasks that must complete before the application starts. EDAS lets you configure sidecar containers and init containers when you create an application, so you can separate these concerns from your application code.

How sidecar and init containers work

Sidecar containers and init containers are special containers that serve different roles in a Pod's lifecycle:

Sidecar container Init container
Lifecycle Runs continuously for the entire Pod lifetime Runs to completion before the application container starts, then exits
Execution order Starts after all init containers finish; runs in parallel with the application container Multiple init containers run sequentially in the order they are defined
Shared resources Shares storage and network with the application container, enabling direct communication Shares the same Pod resources but does not interact with the application container at runtime
Common use cases Log collection, traffic hijacking, configuration updates Preparing config files, downloading dependencies, waiting for services, database migrations

For more details on init containers, see Init Containers in the Kubernetes documentation.

Add sidecar and init containers to an application

You configure sidecar and init containers in the Advanced Settings step of the application creation wizard. The following procedure walks through the full flow.

  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, then 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, set the required parameters and click Next.

  5. In the Configurations step, set the environment information, basic information, deployment method, and resource parameters, then click Next.

  6. In the Advanced Settings step, click Configure sidecars and InitContainers and set the following parameters.

    Sidecar container

    The editor accepts one sidecar container at a time. To add more, click + Add Sidecar Containers.

    Enter the container spec in YAML format. The following example adds a BusyBox sidecar that provides Unix utilities to the application container:

    name: busybox
    image: busybox:latest
    command: ["tail", "-f", "/dev/null"]

    Log collection with shared volumes

    A common sidecar pattern is reading log files written by the application container through a shared volume. Both the application container and the sidecar must mount the same volume for this to work. Define the volume in the Pod spec and reference it in volumeMounts for each container.

    name: logshipper
    image: alpine:latest
    command: ['sh', '-c', 'tail -F /opt/logs.txt']
    volumeMounts:
      - name: shared-logs
        mountPath: /opt

    To collect logs with Logtail using the sidecar pattern, see Use CRDs to collect container text logs in Sidecar mode.

    Init container

    The editor accepts one init container at a time. To add more, click + Add Init Container.

    Enter the container spec in YAML format. The following example delays the application container start by 60 seconds, useful when a dependent service needs time to become ready:

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

    Other common init container patterns:

    • Wait for a service -- Poll a service DNS name until it resolves.

      name: wait-for-db
      image: busybox:latest
      command: ['sh', '-c', 'until nslookup mydb-service; do echo "Waiting for DB..."; sleep 2; done']
    • Download configuration -- Pull a config file from a remote source into a shared volume.

      name: config-fetcher
      image: busybox:latest
      command: ['sh', '-c', 'wget -O /config/app.conf https://config-server/app.conf']
      volumeMounts:
        - name: config-volume
          mountPath: /config

    After configuring sidecar and init containers, click Next.

  7. In the Creation Completed step, click Create Application.

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

    1. After the data refreshes, confirm the precheck items and results, and then click Continue.

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

Verify the deployment

Deployment takes several minutes. To track progress and confirm success:

  1. Go to the Change List page to view change records and monitor the deployment status.

  2. After deployment completes, go to the Application Overview page and check the running status of Pods.

    • If a Pod is in the running state, the application deployed successfully.

    • Click the running status of a Pod to view its Deployments, pods, and advanced configurations.

See also