Skip to content

Commit 93c4dd6

Browse files
committed
remove references to pods, add probes to container configuration information
1 parent bde8cf7 commit 93c4dd6

File tree

2 files changed

+78
-85
lines changed

2 files changed

+78
-85
lines changed

articles/container-apps/containers.md

Lines changed: 77 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ services: container-apps
55
author: craigshoemaker
66
ms.service: container-apps
77
ms.topic: conceptual
8-
ms.date: 05/11/2022
8+
ms.date: 05/12/2022
99
ms.author: cshoe
1010
ms.custom: ignite-fall-2021
1111
---
1212

1313
# Containers in Azure Container Apps Preview
1414

15-
Azure Container Apps manages the details of Kubernetes and container orchestrations for you. Containers in Azure Container Apps can use any runtime, programming language, or development stack of your choice.
15+
Azure Container Apps manages the details of Kubernetes and container orchestration for you. Containers in Azure Container Apps can use any runtime, programming language, or development stack of your choice.
1616

1717
:::image type="content" source="media/containers/azure-container-apps-containers.png" alt-text="Azure Container Apps: Containers":::
1818

@@ -32,31 +32,68 @@ Features include:
3232
3333
## Configuration
3434

35-
The following example configuration shows the options available when setting up a container.
35+
Below 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.
3636

3737
```json
38-
{
39-
...
40-
"template": {
41-
"containers": [
38+
"containers": [
39+
{
40+
"name": "main",
41+
"image": "[parameters('container_image')]",
42+
"env": [
4243
{
43-
"image": "myacr.azurecr.io/myrepo/api-service:v1",
44-
"name": "my-container-image",
45-
"command": ["/bin/queue"],
46-
"args": [],
47-
"env": [
48-
{
49-
"name": "HTTP_PORT",
50-
"value": "8080"
51-
}
52-
],
53-
"resources": {
54-
"cpu": 0.75,
55-
"memory": "1.5Gi"
56-
}
57-
}]
44+
"name": "HTTP_PORT",
45+
"value": "80"
46+
},
47+
{
48+
"name": "SECRET_VAL",
49+
"secretRef": "mysecret"
50+
}
51+
],
52+
"resources": {
53+
"cpu": 0.5,
54+
"memory": "1Gi"
55+
},
56+
"probes":[
57+
{
58+
"type":"liveness",
59+
"httpGet":{
60+
"path":"/health",
61+
"port":8080,
62+
"httpHeaders":[
63+
{
64+
"name":"Custom-Header",
65+
"value":"liveness probe"
66+
}]
67+
},
68+
"initialDelaySeconds":7,
69+
"periodSeconds":3
70+
},
71+
{
72+
"type":"readiness",
73+
"tcpSocket":
74+
{
75+
"port": 8081
76+
},
77+
"initialDelaySeconds": 10,
78+
"periodSeconds": 3
79+
},
80+
{
81+
"type": "startup",
82+
"httpGet": {
83+
"path": "/startup",
84+
"port": 8080,
85+
"httpHeaders": [
86+
{
87+
"name": "Custom-Header",
88+
"value": "startup probe"
89+
}]
90+
},
91+
"initialDelaySeconds": 3,
92+
"periodSeconds": 3
93+
}]
5894
}
59-
}
95+
],
96+
6097
```
6198

6299
| Setting | Description | Remarks |
@@ -68,8 +105,10 @@ The following example configuration shows the options available when setting up
68105
| `env` | An array of key/value pairs that define environment variables. | Use `secretRef` instead of the `value` field to refer to a secret. |
69106
| `resources.cpu` | The number of CPUs allocated to the container. | Values must adhere to the following rules: the value must be greater than zero and less than or equal to 2, and can be any decimal number, with a maximum of two decimal places. For example, `1.25` is valid, but `1.555` is invalid. The default is 0.5 CPU per container. |
70107
| `resources.memory` | The amount of RAM allocated to the container. | This value is up to `4Gi`. The only allowed units are [gibibytes](https://simple.wikipedia.org/wiki/Gibibyte) (`Gi`). Values must adhere to the following rules: the value must be greater than zero and less than or equal to `4Gi`, and can be any decimal number, with a maximum of two decimal places. For example, `1.25Gi` is valid, but `1.555Gi` is invalid. The default is `1Gi` per container. |
108+
| `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).|
109+
71110

72-
The total amount of CPUs and memory requested for all the containers in a container app must add up to one of the following combinations.
111+
When allocating resources, the total amount of CPUs and memory requested for all the containers in a container app must add up to one of the following combinations.
73112

74113
| vCPUs (cores) | Memory |
75114
|---|---|
@@ -82,43 +121,43 @@ The total amount of CPUs and memory requested for all the containers in a contai
82121
| `1.75` | `3.5Gi` |
83122
| `2.0` | `4.0Gi` |
84123

85-
- All of the CPU requests in all of your containers must match one of the values in the vCPUs column.
86-
- All 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.
124+
- The total of the CPU requests in all of your containers must match one of the values in the vCPUs column.
125+
- 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.
87126

88127
## Multiple containers
89128

90-
You can define multiple containers in a single container app. Groups of containers are known as [pods](https://kubernetes.io/docs/concepts/workloads/pods). The containers in a pod share hard disk and network resources and experience the same [application lifecycle](application-lifecycle-management.md).
129+
You can define multiple containers in a single container app. The containers in a container app share hard disk and network resources and experience the same [application lifecycle](application-lifecycle-management.md).
91130

92-
You run multiple containers together by defining more than one container in the configuration's `containers` array.
131+
To run multiple containers in a container app, add more than one container in the `containers` array of the container app template.
93132

94-
Reasons to run containers together in a pod include:
133+
Reasons to run containers together in a container app include:
95134

96135
- Use a container as a sidecar to your primary app.
97-
- Use of a shared disk space and virtual network.
136+
- Share disk space and the same virtual network.
98137
- Share scale rules among containers.
99-
- Group together multiple containers that need to always run together.
100-
- Enable direct communication among containers on the same host.
138+
- Group multiple containers that need to always run together.
139+
- Enable direct communication among containers.
101140

102141
## Container registries
103142

104-
You can deploy images hosted on private registries where credentials are provided through the Container Apps configuration.
143+
You can deploy images hosted on private registries by providing credentials in the Container Apps configuration.
105144

106-
To use a container registry, you first define the required fields to the [configuration's](azure-resource-manager-api-spec.md) `registries` section.
145+
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.
107146

108147
```json
109148
{
110149
...
111150
"registries": [{
112151
"server": "docker.io",
113152
"username": "my-registry-user-name",
114-
"passwordSecretRef": "my-password-secretref-name"
153+
"passwordSecretRef": "my-password-secret-name"
115154
}]
116155
}
117156
```
118157

119-
With this set up, the saved credentials can be used when you reference a container image in an `image` in the `containers` array.
158+
With the registry information setup, the saved credentials can be used to pull a container image from the private registry when your app is deployed.
120159

121-
The following example shows how to deploy an app from the Azure Container Registry.
160+
The following example shows how to configure Azure Container Registry credentials in a container app.
122161

123162
```json
124163
{
@@ -130,6 +169,7 @@ The following example shows how to deploy an app from the Azure Container Regist
130169
"value": "my-acr-password"
131170
}
132171
],
172+
...
133173
"registries": [
134174
{
135175
"server": "myacr.azurecr.io",
@@ -141,53 +181,6 @@ The following example shows how to deploy an app from the Azure Container Regist
141181
}
142182
```
143183

144-
### Managed identity with Azure Container Registry
145-
146-
You can use an Azure managed identity to authenticate with Azure Container Registry instead of using a username and password. To use a managed identity, assign a system-assigned or user-assigned managed identity to your container app, then specify the managed identity you want to use for each registry using the managed identity resource ID for user-assigned, or "system" for system-assigned.
147-
148-
```json
149-
{
150-
"identity": {
151-
"type": "SystemAssigned,UserAssigned",
152-
"userAssignedIdentities": {
153-
"<IDENTITY1_RESOURCE_ID>": {}
154-
}
155-
}
156-
"properties": {
157-
"configuration": {
158-
"registries": [
159-
{
160-
"server": "myacr1.azurecr.io",
161-
"identity": "<IDENTITY1_RESOURCE_ID>"
162-
},
163-
{
164-
"server": "myacr2.azurecr.io",
165-
"identity": "system"
166-
}]
167-
}
168-
...
169-
}
170-
}
171-
```
172-
173-
The managed identity must have `AcrPull` access on the Azure Container Registry. For more information about assigning Azure Container Registry permissions to managed identities, see [Authenticate with managed identity](../container-registry/container-registry-authentication-managed-identity).
174-
175-
System-assigned identities are created at the time your container app is created, and therefore, won't have `AcrPull` access to your Azure Container Registry. As a result, the image can't be pulled from your private registry when your app is first deployed.
176-
177-
To configure a system-assigned identity, you must use one of the following methods.
178-
179-
Use a public registry for the initial deployment:
180-
181-
1. Create your container app using a public image and a system-assigned identity.
182-
1. Give the new system-assigned identity `AcrPull` access to your private Azure Container Registry.
183-
1. Update your container app replacing the public image with the image from your private Azure Container Registry.
184-
185-
Restart your app after assigning permissions:
186-
187-
1. Create your container app using a private image and a system-assigned identity. (The deployment will result in a failure to pull the image.)
188-
1. Give the new system-assigned identity `AcrPull` access to your private Azure Container Registry.
189-
1. Restart your container app revision.
190-
191184
## Limitations
192185

193186
Azure Container Apps has the following limitations:

articles/container-apps/microservices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ms.custom: ignite-fall-2021
2020

2121
:::image type="content" source="media/microservices/azure-container-services-microservices.png" alt-text="Container apps are deployed as microservices.":::
2222

23-
A Container Apps [environment](environment.md) provides a security boundary around a group of container apps. A single container app typically represents a microservice, which is composed of pods made up of one or more [containers](containers.md).
23+
A Container Apps [environment](environment.md) provides a security boundary around a group of container apps. A single container app typically represents a microservice, which is composed of container apps made up of one or more [containers](containers.md).
2424

2525
## Dapr integration
2626

0 commit comments

Comments
 (0)