Question

Difficulty: MediumConfigure Azure Container Instances (ACI)

You are deploying a multi-container group in Azure Container Instances (ACI) that includes a web application container and a log-forwarding sidecar container. The web application container must run continuously to handle user requests, and the sidecar container must also run continuously to read log files generated by the web application. Which of the following configuration settings must you apply to meet these requirements? (Select TWO)

  1. Set the restart policy of the container group to Always.Answer
  2. Define a shared volume and mount it to both containers.Answer
  3. C
    Set the restart policy of the container group to Never.
  4. D
    Set the restart policy of the container group to OnFailure.
  5. E
    Assign a separate public IP address to each container in the container group.

Answer

Configure the container group restart policy to Always and mount a shared volume to both containers.
To support a multi-container scenario where both the web application and logging sidecar run continuously and share log files, you must configure the restart policy of the container group to Always and define a shared volume mounted to both containers. The Always policy ensures that if either container stops, it is automatically restarted. A shared volume allows the log-forwarding sidecar to access the directory where the web application writes its log files.

Step-by-Step Solution

1
Determine the required restart policy for continuous execution.
Identify that the restart policy must be set to Always.
Since both workloads (the web application and the log-forwarding sidecar) are expected to run continuously, setting the policy to Always ensures that ACI automatically restarts either container if it terminates.
2
Determine the mechanism for sharing files between containers in the same container group.
Define a shared volume (such as emptyDir) and mount it to both containers.
Containers in the same group share storage volumes. Mounting a shared volume allows the log-forwarding container to access the logs written by the web application container.
3
Evaluate and eliminate incorrect configuration options.
Eliminate restart policies of Never or OnFailure, and eliminate configurations that attempt to separate network spaces between containers in the same group.
Never and OnFailure do not guarantee that continuously running containers are restarted upon normal termination or exit. In addition, all containers in a container group share a single IP address and network namespace.

Key Concept

Azure Container Instances (ACI) multi-container groups share lifecycle, network, and storage. The restart policy is defined at the group level, and a shared volume is required to share files between containers in the group.
Rate this question