Soru

Zorluk: Çok zorConfigure Azure Container Instances (ACI)

You are designing a deployment plan for multiple containerized workloads in Azure Container Instances (ACI). Match each workload's execution requirements to the appropriate ACI restart policy to ensure correct container lifecycle behavior.

  • An API gateway container that must run continuously to process incoming HTTP requests and restart automatically if it crashes.Always
  • A scheduled data import container that runs a single batch task to completion and must restart automatically only if the task exits with an error code.OnFailure
  • A one-time database migration container that executes a script to copy data and must not run again under any circumstances, even if it fails.Never

Cevap

The API gateway container matches the 'Always' restart policy; the scheduled data import container matches the 'OnFailure' restart policy; and the database migration container matches the 'Never' restart policy.
The correct pairings match the workload characteristics to the standard ACI restart policies: continuous services (API gateway) map to 'Always'; tasks that run once but need a retry on errors (scheduled data import) map to 'OnFailure'; and strict single-execution tasks (database migration) map to 'Never'.

Adım Adım Çözüm

1
Analyze the API gateway container requirements.
The API gateway must run continuously and recover from crashes, meaning its lifecycle is long-running and persistent.
Azure Container Instances supports the 'Always' restart policy for containers that need to be kept running indefinitely.
2
Analyze the scheduled data import container requirements.
The import container runs a single task to completion but must retry if it fails (exits with a non-zero code).
The 'OnFailure' restart policy ensures that ACI restarts the container only when the process exits with a failure status code, preventing restarts on successful completion.
3
Analyze the database migration container requirements.
The migration script must execute exactly once and never retry, regardless of whether it succeeds or fails.
The 'Never' restart policy prevents ACI from restarting the container group under any conditions, ensuring single-execution semantics.

Anahtar Kavram

Azure Container Instances restart policies determine the lifecycle management and automatic recovery behavior of a container group based on its workload type.
Bu soruyu puanla