diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/CommonDefinitions.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/CommonDefinitions.json index 6c90abec3131..ce6e9c10ad55 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/CommonDefinitions.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/CommonDefinitions.json @@ -74,6 +74,16 @@ "$ref": "#/definitions/ContainerResources", "description": "Container resource requirements." }, + "probes": { + "description": "List of probes for the container.", + "type": "array", + "items": { + "$ref": "#/definitions/ContainerAppProbe" + }, + "x-ms-identifiers": [ + "type" + ] + }, "volumeMounts": { "description": "Container volume mounts.", "type": "array", @@ -101,6 +111,124 @@ } } }, + "ContainerAppProbe": { + "description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", + "type": "object", + "properties": { + "failureThreshold": { + "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. Maximum value is 10.", + "type": "integer", + "format": "int32" + }, + "httpGet": { + "description": "HTTPGet specifies the http request to perform.", + "type": "object", + "required": [ + "port" + ], + "properties": { + "host": { + "description": "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.", + "type": "string" + }, + "httpHeaders": { + "description": "Custom headers to set in the request. HTTP allows repeated headers.", + "type": "array", + "items": { + "description": "HTTPHeader describes a custom header to be used in HTTP probes", + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "description": "The header field name", + "type": "string" + }, + "value": { + "description": "The header field value", + "type": "string" + } + } + }, + "x-ms-identifiers": [ + "name" + ] + }, + "path": { + "description": "Path to access on the HTTP server.", + "type": "string" + }, + "port": { + "description": "Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.", + "type": "integer", + "format": "int32" + }, + "scheme": { + "description": "Scheme to use for connecting to the host. Defaults to HTTP.", + "type": "string" + } + } + }, + "initialDelaySeconds": { + "description": "Number of seconds after the container has started before liveness probes are initiated. Minimum value is 1. Maximum value is 60.", + "type": "integer", + "format": "int32" + }, + "periodSeconds": { + "description": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value is 240.", + "type": "integer", + "format": "int32" + }, + "successThreshold": { + "description": "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. Maximum value is 10.", + "type": "integer", + "format": "int32" + }, + "tcpSocket": { + "description": "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported.", + "type": "object", + "required": [ + "port" + ], + "properties": { + "host": { + "description": "Optional: Host name to connect to, defaults to the pod IP.", + "type": "string" + }, + "port": { + "description": "Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.", + "type": "integer", + "format": "int32" + } + } + }, + "terminationGracePeriodSeconds": { + "description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. Maximum value is 3600 seconds (1 hour)", + "type": "integer", + "format": "int64" + }, + "timeoutSeconds": { + "description": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is 240.", + "type": "integer", + "format": "int32" + }, + "type": { + "description": "The type of probe.", + "enum": [ + "liveness", + "readiness", + "startup" + ], + "type": "string", + "x-ms-enum": { + "name": "Type", + "modelAsString": true + } + } + } + }, "CustomScaleRule": { "description": "Container App container Custom scaling rule.", "type": "object", diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json index cda55c80d86e..9abc4e1b95ca 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json @@ -18,7 +18,24 @@ "containers": [ { "image": "repo/testcontainerApp0:v1", - "name": "testcontainerApp0" + "name": "testcontainerApp0", + "probes": [ + { + "type": "liveness", + "httpGet": { + "path": "/health", + "port": 8080, + "httpHeaders": [ + { + "name": "Custom-Header", + "value": "Awesome" + } + ] + }, + "initialDelaySeconds": 3, + "periodSeconds": 3 + } + ] } ], "scale": { @@ -73,7 +90,24 @@ "resources": { "cpu": 0.2, "memory": "100Mi" - } + }, + "probes": [ + { + "type": "liveness", + "httpGet": { + "path": "/health", + "port": 8080, + "httpHeaders": [ + { + "name": "Custom-Header", + "value": "Awesome" + } + ] + }, + "initialDelaySeconds": 3, + "periodSeconds": 3 + } + ] } ], "scale": { @@ -126,7 +160,24 @@ "resources": { "cpu": 0.2, "memory": "100Mi" - } + }, + "probes": [ + { + "type": "liveness", + "httpGet": { + "path": "/health", + "port": 8080, + "httpHeaders": [ + { + "name": "Custom-Header", + "value": "Awesome" + } + ] + }, + "initialDelaySeconds": 3, + "periodSeconds": 3 + } + ] } ], "scale": {