All Products
Search
Document Center

Elastic Container Instance:Ignore the NotReady state of the sidecar container

Last Updated:Apr 01, 2026

Elastic Container Instance (ECI) does not support Kubernetes DaemonSets on virtual nodes. A common workaround is to inject a sidecar container into an ECI-based pod to replicate DaemonSet behavior — for example, to run a log collector or monitoring agent. By default, if that sidecar enters a NotReady state, the entire pod is marked NotReady, which blocks traffic to otherwise-healthy application containers. To decouple sidecar readiness from pod readiness, set the ECI_CONTAINER_IGNORE_READY environment variable on the sidecar container.

How it works

Pod readiness is determined by two conditions in status.conditions:

ConditionMeaning
ContainersReadyAll containers in the pod are ready.
ReadyThe pod can serve requests (used by Services for load balancing).

Normally, if any container is NotReady, both conditions are False. When you set ECI_CONTAINER_IGNORE_READY: "true" on a container, ECI excludes that container from readiness evaluation. Both ContainersReady and Ready can reach True even while that container remains NotReady.

Prerequisites

Before you begin, make sure you have:

  • An ACK Serverless cluster with ECI-based virtual nodes

  • kubectl configured to connect to your cluster

Ignore the NotReady state of a sidecar container

  1. Create a Deployment manifest. The following example creates a Deployment with two containers: c1 runs normally, and c2 has no startup command and cannot enter the Ready state. ECI_CONTAINER_IGNORE_READY is set on c2 to exclude it from readiness evaluation.

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: test-ignore
      labels:
        app: test
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: test
      template:
        metadata:
          labels:
            app: test
        spec:
          containers:
          - name: c1
            image: registry.cn-shanghai.aliyuncs.com/eci_open/perl:5
            command: ["/bin/sh", "-c", "sleep 999"]
          - name: c2
            image: registry.cn-shanghai.aliyuncs.com/eci_open/centos:7
            env:
            - name: ECI_CONTAINER_IGNORE_READY
              value: "true"
  2. Apply the manifest.

    kubectl apply -f test-ignore.yaml

Verify the configuration

After the pod starts, check its readiness conditions to confirm that the NotReady state of c2 is being ignored.

  1. Retrieve the pod status.

    kubectl get pod <pod-name> -o yaml
  2. In the output, locate the status.conditions section. With ECI_CONTAINER_IGNORE_READY set correctly, both conditions show True:

    status:
      conditions:
      - type: ContainersReady
        status: "True"
      - type: Ready
        status: "True"

The following screenshot shows an example of the expected output.

忽略容器notready.png