Skip to content

Commit b4b0149

Browse files
Merge pull request #281575 from anthonychu/20240723-aca-update-containers
[Container Apps] Update containers page
2 parents 7147f68 + de370b1 commit b4b0149

File tree

1 file changed

+42
-45
lines changed

1 file changed

+42
-45
lines changed

articles/container-apps/containers.md

Lines changed: 42 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Azure Container Apps manages the details of Kubernetes and container orchestrati
1717

1818
Azure Container Apps supports:
1919

20-
- Any Linux-based x86-64 (`linux/amd64`) container image with no required base image
20+
- Any Linux-based x86-64 (`linux/amd64`) container image
2121
- Containers from any public or private container registry
2222
- [Sidecar](#sidecar-containers) and [init](#init-containers) containers
2323

@@ -33,7 +33,7 @@ Jobs features include:
3333

3434
## Configuration
3535

36-
The following code is an example of the `containers` array in the [`properties.template`](azure-resource-manager-api-spec.md#propertiestemplate) section of a container app resource template. The excerpt shows the available configuration options when setting up a container.
36+
Most container apps have a single container. In advanced scenarios, an app may also have sidecar and init containers. In a container app definition, the main app and its sidecar containers are listed in the `containers` array in the [`properties.template`](azure-resource-manager-api-spec.md#propertiestemplate) section, and init containers are listed in the `initContainers` array. The following excerpt shows the available configuration options when setting up an app's containers.
3737

3838
```json
3939
{
@@ -134,50 +134,47 @@ The following code is an example of the `containers` array in the [`properties.t
134134
| `name` | Friendly name of the container. | Used for reporting and identification. |
135135
| `command` | The container's startup command. | Equivalent to Docker's [entrypoint](https://docs.docker.com/engine/reference/builder/) field. |
136136
| `args` | Start up command arguments. | Entries in the array are joined together to create a parameter list to pass to the startup command. |
137-
| `env` | An array of key/value pairs that define environment variables. | Use `secretRef` instead of the `value` field to refer to a secret. |
138-
| `resources.cpu` | The number of CPUs allocated to the container. | With the [Consumption plan](plans.md), values must adhere to the following rules:<br><br>• greater than zero<br>• less than or equal to 2<br>• can be any decimal number (with a max of two decimal places)<br><br> For example, `1.25` is valid, but `1.555` is invalid.<br> The default is 0.25 CPUs per container.<br><br>When you use the Consumption workload profile on the Dedicated plan, the same rules apply, except CPUs must be less than or equal to 4.<br><br>When you use the [Dedicated plan](plans.md), the maximum CPUs must be less than or equal to the number of cores available in the profile where the container app is running. |
139-
| `resources.memory` | The amount of RAM allocated to the container. | With the [Consumption plan](plans.md), values must adhere to the following rules:<br><br>• greater than zero<br>• less than or equal to `4Gi`<br>• can be any decimal number (with a max of two decimal places)<br><br>For example, `1.25Gi` is valid, but `1.555Gi` is invalid.<br>The default is `0.5Gi` per container.<br><br>When you use the Consumption workload on the [Dedicated plan](plans.md), the same rules apply except memory must be less than or equal to `8Gi`.<br><br>When you use the Dedicated plan, the maximum memory must be less than or equal to the amount of memory available in the profile where the container app is running. |
140-
| `volumeMounts` | An array of volume mount definitions. | You can define a temporary volume or multiple permanent storage volumes for your container. For more information about storage volumes, see [Use storage mounts in Azure Container Apps](storage-mounts.md).|
141-
| `probes`| An array of health probes enabled in the container. | This feature is based on Kubernetes health probes. For more information about probes settings, see [Health probes in Azure Container Apps](health-probes.md).|
142-
143-
<a id="allocations"></a>
144-
145-
When you use either the Consumption plan or a Consumption workload on the Dedicated plan, the total CPU and memory allocations requested for all the containers in a container app must add up to one of the following combinations.
146-
147-
| vCPUs (cores) | Memory | Consumption plan | Consumption workload profile |
148-
|---|---|---|---|
149-
| `0.25` | `0.5Gi` |||
150-
| `0.5` | `1.0Gi` |||
151-
| `0.75` | `1.5Gi` |||
152-
| `1.0` | `2.0Gi` |||
153-
| `1.25` | `2.5Gi` |||
154-
| `1.5` | `3.0Gi` |||
155-
| `1.75` | `3.5Gi` |||
156-
| `2.0` | `4.0Gi` |||
157-
| `2.25` | `4.5Gi` | ||
158-
| `2.5` | `5.0Gi` | ||
159-
| `2.75` | `5.5Gi` | ||
160-
| `3.0` | `6.0Gi` | ||
161-
| `3.25` | `6.5Gi` | ||
162-
| `3.5` | `7.0Gi` | ||
163-
| `3.75` | `7.5Gi` | ||
164-
| `4.0` | `8.0Gi` | ||
165-
166-
- The total of the CPU requests in all of your containers must match one of the values in the *vCPUs* column.
167-
168-
- The total of the memory requests in all your containers must match the memory value in the memory column in the same row of the CPU column.
169-
170-
When you use the Consumption profile on the Dedicated plan, the total CPU and memory allocations requested for all the containers in a container app must be less than or equal to the cores and memory available in the profile.
137+
| `env` | An array of name/value pairs that define environment variables. | Use `secretRef` instead of the `value` field to refer to a secret. |
138+
| `resources.cpu` | The number of CPUs allocated to the container. | See [vCPU and memory allocation requirements](#allocations) |
139+
| `resources.memory` | The amount of RAM allocated to the container. | See [vCPU and memory allocation requirements](#allocations) |
140+
| `volumeMounts` | An array of volume mount definitions. | You can define a temporary or permanent storage volumes for your container. For more information about storage volumes, see [Use storage mounts in Azure Container Apps](storage-mounts.md).|
141+
| `probes`| An array of health probes enabled in the container. | For more information about probes settings, see [Health probes in Azure Container Apps](health-probes.md).|
142+
143+
### <a name="allocations"></a>vCPU and memory allocation requirements
144+
145+
When you use the Consumption plan, the total CPU and memory allocated to all the containers in a container app must add up to one of the following combinations.
146+
147+
| vCPUs (cores) | Memory |
148+
|---|---|
149+
| `0.25` | `0.5Gi` |
150+
| `0.5` | `1.0Gi` |
151+
| `0.75` | `1.5Gi` |
152+
| `1.0` | `2.0Gi` |
153+
| `1.25` | `2.5Gi` |
154+
| `1.5` | `3.0Gi` |
155+
| `1.75` | `3.5Gi` |
156+
| `2.0` | `4.0Gi` |
157+
| `2.25` | `4.5Gi` |
158+
| `2.5` | `5.0Gi` |
159+
| `2.75` | `5.5Gi` |
160+
| `3.0` | `6.0Gi` |
161+
| `3.25` | `6.5Gi` |
162+
| `3.5` | `7.0Gi` |
163+
| `3.75` | `7.5Gi` |
164+
| `4.0` | `8.0Gi` |
165+
166+
> [!NOTE]
167+
> Apps using the Consumption plan in a *Consumption only* environment are limited to a maximum of 2 cores and 4Gi of memory.
171168
172169
## Multiple containers
173170

174171
In advanced scenarios, you can run multiple containers in a single container app. Use this pattern only in specific instances where your containers are tightly coupled.
175172

176173
For most microservice scenarios, the best practice is to deploy each service as a separate container app.
177174

178-
The multiple containers in the same container app share hard disk and network resources and experience the same [application lifecycle](./application-lifecycle-management.md).
175+
Multiple containers in the same container app share hard disk and network resources and experience the same [application lifecycle](./application-lifecycle-management.md).
179176

180-
There are two ways to run multiple containers in a container app: [sidecar containers](#sidecar-containers) and [init containers](#init-containers).
177+
There are two ways to run additional containers in a container app: [sidecar containers](#sidecar-containers) and [init containers](#init-containers).
181178

182179
### Sidecar containers
183180

@@ -200,13 +197,13 @@ You can define one or more [init containers](https://kubernetes.io/docs/concepts
200197
Init containers are defined in the `initContainers` array of the container app template. The containers run in the order they're defined in the array and must complete successfully before the primary app container starts.
201198

202199
> [!NOTE]
203-
> Init containers support [image pulls using managed identities](#managed-identity-with-azure-container-registry), but processes running in init containers don't have access to managed identities.
200+
> Init containers in apps using the Dedicated plan or running in a *Consumption only* environment can't access managed identity at run time.
204201
205202
## Container registries
206203

207204
You can deploy images hosted on private registries by providing credentials in the Container Apps configuration.
208205

209-
To use a container registry, you define the required fields in `registries` array in the [`properties.configuration`](azure-resource-manager-api-spec.md) section of the container app resource template. The `passwordSecretRef` field identifies the name of the secret in the `secrets` array name where you defined the password.
206+
To use a container registry, you define the registry in the `registries` array in the [`properties.configuration`](azure-resource-manager-api-spec.md) section of the container app resource template. The `passwordSecretRef` field identifies the name of the secret in the `secrets` array name where you defined the password.
210207

211208
```json
212209
{
@@ -229,16 +226,16 @@ The following example shows how to configure Azure Container Registry credential
229226
"configuration": {
230227
"secrets": [
231228
{
232-
"name": "acr-password",
233-
"value": "my-acr-password"
229+
"name": "docker-hub-password",
230+
"value": "my-docker-hub-password"
234231
}
235232
],
236233
...
237234
"registries": [
238235
{
239-
"server": "myacr.azurecr.io",
236+
"server": "docker.io",
240237
"username": "someuser",
241-
"passwordSecretRef": "acr-password"
238+
"passwordSecretRef": "docker-hub-password"
242239
}
243240
]
244241
}
@@ -252,7 +249,7 @@ The following example shows how to configure Azure Container Registry credential
252249

253250
You can use an Azure managed identity to authenticate with Azure Container Registry instead of using a username and password. For more information, see [Managed identities in Azure Container Apps](managed-identity.md).
254251

255-
When assigning a managed identity to a registry, use the managed identity resource ID for a user-assigned identity, or `system` for the system-assigned identity.
252+
To use managed identity with a registry, the identity must be enabled in the app and it must be assigned `acrPull` role in the registry. To configure the registry, use the managed identity resource ID for a user-assigned identity, or `system` for the system-assigned identity in the `identity` property of the registry. Don't configure a username and password when using managed identity.
256253

257254
```json
258255
{

0 commit comments

Comments
 (0)